Hi,
if some one open a issue on github we need to manually add the No Code Attached Yet
label.
As the code that manage it looks wrong to me?
This trigger the event: https://github.com/joomla/jissues/blob/master/src/App/Tracker/Controller/Hooks/ReceiveIssuesHook.php#L135
$this->triggerEvent('onIssueAfterCreate', $table, array('action' => $action));
but we use it only with one argument here:
public function onIssueAfterCreate(Event $event)
Is there a reason to pass the action? As we don't use it later. To get the action we use the following code:
// Pull the arguments array
$arguments = $event->getArguments();
// Only perform these events if this is a new issue, action will be 'opened'
if ($arguments['action'] === 'opened')
{
hmm than it looks correct. Do you have any idea why it fails than?
I've got nothing. No log messages and the class name is correct for the expectation to register the listener.
@mbabker can we try the following debug code here:
https://github.com/joomla/jissues/blob/master/src/App/Tracker/Controller/Hooks/Listeners/JoomlacmsIssuesListener.php#L36
$logger->info(
sprintf(
'onIssueAfterCreate for %s/%s #%d - Action: %s',
$project->gh_user,
$project->gh_project,
$hookData->issue->number,
$arguments['action']
)
);
If that is in i can open a issue on github. To be sure we get in and no other "action" than opened
is set here?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-10-17 22:57:54 |
Closed_By | ⇒ | zero-24 |
The trigger is right. The way the Framework's Event class is designed, all of your arguments have to be added through the
addArgument()
method (unless you subclass it and add a "pretty" API for setting arguments) and then within the event listener you have to fetch out your arguments array via thegetArguments()
method. If you dig into the triggerEvent() method you'll see that we default inject a bunch of arguments into the event and that third argument (the array with the action) allows additional optional arguments for the event based on context.