Key plugin install/update event subscribers on the event class (Mautic 8) - #634
Key plugin install/update event subscribers on the event class (Mautic 8)#634promptless-for-oss wants to merge 8 commits into
Conversation
|
I noticed that some CI checks failed for this PR. I'm investigating whether the failures are caused by this suggestion. If they're unrelated or pre-existing, I'll leave this suggestion unchanged and create a separate suggestion if a standalone docs fix is needed. |
|
Thanks @escopecz — noted. Since the |
|
Update: confirmed against #17162 — I'm dropping both the "constants remain defined but unused" and the "silent failure" points from the note, keeping the Symfony 4.3 explanation and the guidance for event families that still dispatch by string constant. Revising the PR now. |
Drop the 'PluginEvents constants remain defined but unused' and 'silent failure' framing per maintainer @escopecz's review on PR mautic#634; the constants are being removed and do nothing when used. Scope the class-name dispatch change to PluginBundle.
|
@escopecz both comments are addressed. The note in |
|
Thanks @escopecz — got it. I'll drop that sentence about PluginBundle being the only event dispatch that changed, since all the events are being updated the same way, and update this PR shortly. |
Per maintainer @escopecz review on PR mautic#634: all Mautic events are being migrated to Symfony 4.3 dispatch-by-class the same way, so the PluginBundle-only scoping caveat is inaccurate. Removes the two sentences from the version-aware note in docs/plugins/installation.rst.
|
Done @escopecz — the version-aware note in |
|
I noticed that some CI checks failed for this PR. I'm investigating whether the failures are caused by this suggestion. If they're unrelated or pre-existing, I'll leave this suggestion unchanged and create a separate suggestion if a standalone docs fix is needed. |
The base branch was changed.
Replace this page's copy of the general Mautic 8 class-name event dispatch explanation with a cross-reference to the shared "Mautic 8: class-name event dispatch" section in plugins/event_listeners.rst, keeping the bundle-specific facts. Part of consolidating the duplicated note across the open Mautic 8 dev-docs PRs.
Open in Promptless
Since Mautic 8, PluginBundle dispatches its events using the Symfony 4.3 style, where the event object's class name is the event name. The plugin install and update subscriber example in
docs/plugins/installation.rstnow keysgetSubscribedEvents()onPluginInstallEvent::classandPluginUpdateEvent::classinstead of thePluginEvents::ON_PLUGIN_INSTALLandPluginEvents::ON_PLUGIN_UPDATEstring constants, and drops the now-unusedPluginEventsimport. A version-aware note explains that Mautic dispatches these events by the event object alone (Symfony 4.3 style).Review feedback applied (maintainer @escopecz on this PR):
PluginEventsconstants remain defined but unused.Trigger Events