Fixed: Joomla 5 event ArrayAccess pattern for service plugin collection #86

Closed
opened 2026-05-29 05:30:24 +00:00 by jmiller · 1 comment
Owner

Fixed in commit 8dd6fdd

Severity: High — service plugin map was always empty

What was wrong:
The new Event('name', [&$array]) pattern doesn't preserve PHP references in Joomla 5's Event class. Service plugins using SubscriberInterface receive the Event object (not raw args) and append via ArrayAccess. The original code expected by-reference modification of the array, which never worked.

Fix applied:
After dispatching the event, read service plugins from Event ArrayAccess indices (1, 2, 3...) instead of expecting the original array to be modified.

Files: CrossPostDispatcher.php, QueueProcessor.php, DispatchController.php

Label: priority: high, status: pending-testing

## Fixed in commit 8dd6fdd **Severity:** High — service plugin map was always empty **What was wrong:** The `new Event('name', [&$array])` pattern doesn't preserve PHP references in Joomla 5's Event class. Service plugins using SubscriberInterface receive the Event object (not raw args) and append via ArrayAccess. The original code expected by-reference modification of the array, which never worked. **Fix applied:** After dispatching the event, read service plugins from Event ArrayAccess indices (1, 2, 3...) instead of expecting the original array to be modified. **Files:** `CrossPostDispatcher.php`, `QueueProcessor.php`, `DispatchController.php` **Label:** `priority: high`, `status: pending-testing`
Author
Owner

Branch created: feature/86-fixed-joomla-5-event-arrayaccess-pattern

git fetch origin
git checkout feature/86-fixed-joomla-5-event-arrayaccess-pattern
Branch created: [`feature/86-fixed-joomla-5-event-arrayaccess-pattern`](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomCross/src/branch/feature/86-fixed-joomla-5-event-arrayaccess-pattern) ```bash git fetch origin git checkout feature/86-fixed-joomla-5-event-arrayaccess-pattern ```
Sign in to join this conversation.
Type Bug
Status
Priority
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCross#86