Curious, in the new joomla actions logs we are running onUserAfterSaveGroup see:
public function onUserAfterSaveGroup($context, $table, $isNew)
{
$context = $this->app->input->get('option');
But as you can see we are overwriting context instantly? Why? If we need to fetch the $option shouldn't we be defining it as $option?
Labels |
Added:
?
|
Title |
|
Title |
|
Labels |
Added:
J3 Issue
|
Status | New | ⇒ | Discussion |
Category | ⇒ | com_csp |
Status | Discussion | ⇒ | New |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-12-26 16:27:13 |
Closed_By | ⇒ | chmst |
Thanks, the logic still doesn't make sense to me though. Why are we even passing in $context? is it for legacy reasons?
Because "context" is "wrongly" used, most of the time it's the extension which "owns" the data for example if you want to execute onContentAfterTitle for a com_content article you set the context 'com_content.article' even in your own component.
Which is wrong in my opinion, I would expect the context is the "situation" the event is called and that you supply a $extension for the data "owner".
I didn't checked the code but you suspect that this is the reason why we override the context with the "component" (parts of the extension).
I was wondering the same.