Skip to content

Add Mautic 8 Plugin upgrade guide for *Common class type changes - #616

Open
promptless-for-oss wants to merge 2 commits into
mautic:7.2from
Promptless:promptless/pr-17005-common-class-type-bc-breaks
Open

Add Mautic 8 Plugin upgrade guide for *Common class type changes#616
promptless-for-oss wants to merge 2 commits into
mautic:7.2from
Promptless:promptless/pr-17005-common-class-type-bc-breaks

Conversation

@promptless-for-oss

@promptless-for-oss promptless-for-oss commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Open in Promptless

Mautic 8 adds native PHP parameter, return, and property type declarations to the base and abstract classes that Plugins and Integrations commonly extend. The types are only made explicit — there's no runtime behavior change — but any subclass whose override or re-declared property no longer matches the parent's now-explicit signature throws a fatal TypeError or compile error on Mautic 8.

This adds a new developer upgrade guide, "Update Plugins for Mautic 8" (docs/plugins/update_m7_to_m8.rst), modeled on the existing "Update Plugins for Mautic 5" page. It explains the four kinds of break (added parameter type, added return type, added property type, removed property) and the governing "copy the parent signature exactly" rule, with before/after diff blocks for each affected base class the PR title names — controllers, repositories, permissions, and integrations:

  • CommonRepository
  • AbstractPermissions (isGranted() and the add*FormFields() methods now take array)
  • AbstractIntegration and CrmAbstractIntegration
  • CommonController and AbstractFormController (the MVC/form controllers Plugins extend for CRUD interfaces; AbstractStandardFormController follows the same pattern)
  • CommonApiController (including the prepareParametersForBinding fall-through TypeError trap and the batch actions now returning Response)
  • FetchCommonApiController (typed properties plus the removed $parametersContainer)

It also updates the isGranted() example in docs/plugins/permissions.rst to the Mautic 8 signature, so the cross-referenced example no longer shows code that would trigger the exact TypeError this upgrade guide warns about. The guide cross-references the existing repository, permissions, MVC, and API-controller extension examples and registers the page in the Plugins toctree.

Trigger Events

promptless Bot added 2 commits August 9, 2026 17:01
Documents the backward-compatibility break from mautic/mautic PR #17005,
which adds native PHP parameter/return/property types to widely-extended
base classes (CommonRepository, AbstractIntegration, CrmAbstractIntegration,
CommonApiController, FetchCommonApiController). Explains the four break kinds
and the copy-the-parent-signature-exactly rule for Plugin/Integration authors.
…de guide

Extend docs/plugins/update_m7_to_m8.rst with the two remaining break
categories from mautic/mautic PR #17005 that plugin developers extend:
AbstractPermissions (isGranted/add*FormFields now take array) and the
MVC/form controllers CommonController and AbstractFormController. Also
update the isGranted example in plugins/permissions.rst to the Mautic 8
signature so the cross-referenced example no longer triggers the
TypeError the upgrade guide warns about.
@promptless-for-oss
promptless-for-oss marked this pull request as ready for review August 10, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant