User tests: Successful: 0 Unsuccessful: 0
Pull Request for discussion #35396 (comment).
Injects a dispatcher into the MVC layer, so we can trigger the events trough it. It removes the need to use the static call on the Factory. A new helper function dispatchEvent
is added to the BaseDatabaseModel
and AbstractView
which does a fallback to the global dispatcher when none is available. This is is handy as most of the events are sent out in models or views and it guarantees backwards compatibility when an extension uses the model or view outside of the MVC context.
Before you did
Factory::getApplication()->triggerEvent('myEvent', $event);
or
Factory::getApplication()->getDispatcher()->dispatch('myEvent', $event);
Now you can do
$this->getDispatcher()->dispatch('myEvent', $event);
or
$this->dispatchEvent($event);
Works.
Works.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Category | Libraries | ⇒ | Front End com_content Libraries |
As you can see, every details view, like the articles view, is triggering events. There are more the controllers which do not fir events.
I have tested this item
I have tested this item
Applied patch, save article, access to article, perform some batch actions (as changed in this PR) and it is still working. So the PR is working as described.
(I don't understand our event system good enough to confirm this is right or wrong, I just follow the testing instructions to test)
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
@bembelimen friendly reminder
@bembelimen friendly reminder
Could you please update your branch with the latest 4.1-dev, then I can merge it (I think you didn't check the checkbox that maintainer can do it).
DOne
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-11-30 18:13:41 |
Closed_By | ⇒ | bembelimen |
Thx
I think this makes sense for controller and model - less so for the view.