fix: Joomla 6 event type compatibility in content plugin #207

Merged
jmiller merged 2 commits from fix/joomla6-event-handlers into dev 2026-06-28 18:46:12 +00:00
Owner

Summary

  • Remove strict type hints on onContentAfterSave() and onContentChangeState() in the content plugin
  • Joomla 6 dispatches Model\AfterSaveEvent / Model\ContentChangeStateEvent instead of Content\AfterSaveEvent / Content\ContentChangeStateEvent
  • Untyped $event parameters accept both Joomla 5 and 6 event objects (same pattern as the webservices plugin)

Fixes fatal error: Argument #1 ($event) must be of type AfterSaveEvent, Joomla\CMS\Event\Model\AfterSaveEvent given

Test plan

  • Save an article on Joomla 6 -- no fatal error
  • Verify cross-posting triggers on article publish
  • Verify delete-on-unpublish still fires via onContentChangeState
## Summary - Remove strict type hints on `onContentAfterSave()` and `onContentChangeState()` in the content plugin - Joomla 6 dispatches `Model\AfterSaveEvent` / `Model\ContentChangeStateEvent` instead of `Content\AfterSaveEvent` / `Content\ContentChangeStateEvent` - Untyped `$event` parameters accept both Joomla 5 and 6 event objects (same pattern as the webservices plugin) Fixes fatal error: `Argument #1 ($event) must be of type AfterSaveEvent, Joomla\CMS\Event\Model\AfterSaveEvent given` ## Test plan - [ ] Save an article on Joomla 6 -- no fatal error - [ ] Verify cross-posting triggers on article publish - [ ] Verify delete-on-unpublish still fires via onContentChangeState
jmiller added 2 commits 2026-06-28 18:45:58 +00:00
fix: use typed Joomla 6 event parameters, remove legacy fallbacks
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 10s
c1fa8c816e
Joomla 6 dispatches Model\AfterSaveEvent and Model\ContentChangeStateEvent
instead of Content\AfterSaveEvent and Content\ContentChangeStateEvent.
Remove specific type hints to accept both Joomla 5 and 6 event objects.

Authored-by: Moko Consulting
chore(version): pre-release bump to 01.11.01-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
ed5a143439
jmiller merged commit 133944620b into dev 2026-06-28 18:46:12 +00:00
jmiller deleted branch fix/joomla6-event-handlers 2026-06-28 18:46:12 +00:00
Sign in to join this conversation.
No Reviewers
No labels
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#207