Skip to content

Document Mautic 8 class-name dispatch for ReportBundle events - #650

Open
promptless-for-oss wants to merge 3 commits into
mautic:7.2from
Promptless:promptless/pr-17200-report-events-by-class
Open

Document Mautic 8 class-name dispatch for ReportBundle events#650
promptless-for-oss wants to merge 3 commits into
mautic:7.2from
Promptless:promptless/pr-17200-report-events-by-class

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

Open in Promptless

Mautic 8 dispatches ReportBundle events in the Symfony 4.3 style, where the event object alone identifies the event and its class name is the event name. A Report subscriber now keys getSubscribedEvents() on the event class (for example ReportBuilderEvent::class) instead of a Mautic\ReportBundle\ReportEvents string constant.

This updates the Reports plugin-extension page to match: the code example and prose now reference ReportBuilderEvent, ReportGeneratorEvent, and ReportGraphEvent, the now-unused ReportEvents import is removed, and a note plus a constant-to-class mapping table explain the change. The note warns that the ReportEvents constants remain defined for backwards compatibility but are no longer used for internal dispatch, so a subscriber still keyed on one of these constants stops receiving the event and must be updated to key on the event class.

Reflects mautic/mautic#17200 (base branch 8.x), so it targets docs branch 7.2 per the branch-targeting rule.

Trigger Events

Update the Reports plugin-extension page for the Symfony 4.3-style event
dispatch introduced in mautic/mautic#17200. Report subscribers now key
getSubscribedEvents() on the event class (ReportBuilderEvent::class, etc.)
instead of a ReportEvents string constant. Adds a migration note and a
constant-to-class mapping table, and converts the code example and prose
references accordingly.
Comment thread docs/plugin_extensions/reports.rst Outdated

.. note::

Since Mautic 8, subscribers key ``getSubscribedEvents()`` on the event class (for example, ``ReportBuilderEvent::class``), following the Symfony 4.3 style rather than a ``ReportEvents`` constant. The ``ReportEvents`` constants remain defined, so code that references them still compiles. However, a subscriber that still keys on one of these ``ReportEvents`` constants no longer receives the event, and you must update it to key on the event class instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@promptless-for-oss we use hypen instead of parentheses.

@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks @adiati98 — on it. I'll rework the parenthetical asides in the added note to use the hyphen/dash convention and push the update to this PR shortly.

Per maintainer @adiati98's review on PR mautic#650, convert the parenthetical
aside in the ReportBundle events note to the repo's spaced-hyphen
convention.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Done @adiati98 — reworked the parenthetical aside in the note to use the spaced-hyphen form (- for example, ``ReportBuilderEvent::class`` -), matching the repo convention. Pushed to this PR branch and Vale is clean. Ready for another look.

@promptless-for-oss
promptless-for-oss marked this pull request as ready for review September 2, 2026 18:01

@TomasVotruba TomasVotruba left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants