-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Trigger the onBeforeExecute correctly through the dispatcher #20448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I have tested this item ✅ successfully on 3fbe042 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20448. |
|
I have tested this item ✅ successfully on ac6b179 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20448. |
|
@infograf768 can you please retest? |
| // Trigger the onBeforeExecute event | ||
| $this->getDispatcher()->dispatch( | ||
| 'onBeforeExecute', | ||
| new BeforeExecuteEvent('onBeforeExecute', ['subject' => $this, 'container' => $this->getContainer()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't work sadly :( The getContainer doesn't exist in this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a PR to fix it
Pull Request for Issue #20435.
Summary of Changes
Sends the
onBeforeExecutecorrectly in the applications.Testing Instructions
Enable the language filter plugin.
Expected result
No exception is thrown.
Actual result
Exception
Argument 1 passed to PlgSystemLanguageFilter::onBeforeExecute() must be an instance of Joomla\CMS\Event\BeforeExecuteEvent, instance of Joomla\Event\Event given
is thrown.