User tests: Successful: Unsuccessful:
The event that everyone waiting for :)
This should finally solve an issue everyone hit when need to access to Document at early stage, but onAfterRoute document not available and onAfterDispatch is to late.
PR also add a general Document event class, it introduce classes for 2 events: AfterInitialiseDocumentEvent, BeforeCompileHeadEvent
Note
Before we can merge this PR it would be good to add CMS\ApplicationEvent, and the document event should be a child of it (because technically it is Application event).
Thoughts?
Apply #40522 then apply current patch. Solve conflicts.
Add in any System plugin:
public function onAfterInitialiseDocument(Joomla\CMS\Event\Application\AfterInitialiseDocumentEvent $event)
{
var_dump($event->getDocument()->getTitle());
}Nothing
You should see Dump output.
Please select:
| Category | ⇒ | Libraries |
| Status | New | ⇒ | Pending |
| Labels |
Added:
PR-5.0-dev
|
||
Note: I have removed Event classes from this PR, it is better to do separately, with all Application events.
Note: I have removed Event classes from this PR, it is better to do separately, with all Application events.
Nope, all new events must have a corresponding class, also you don't provide the $document in the event now.
please revert your cleanup again.
all new events must have a corresponding class
I fully agree, but unfortunately here we have to wait when Application event classes will be implemented.
Doing it here will be like runing on front of a train.
I mean that PR should go first. Then classes can be added in this one.
I maybe try to preapre something later.
| Labels |
Added:
Feature
|
||
| Status | Pending | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-07-21 11:52:55 |
| Closed_By | ⇒ | HLeithner |
thanks
maybe we get a manual.joomla.org entry please?
I will make it.
Also will be need update https://docs.joomla.org/Plugin/Events#System
Merge it!