fix(joomla6): update webservices plugins for Joomla 6 typed event API #164

Closed
opened 2026-05-26 18:33:36 +00:00 by jmiller · 4 comments
Owner

Summary

Joomla 6 changed the event handler system. Plugins using SubscriberInterface now receive a typed event object as the first argument instead of pass-by-reference parameters. This breaks all plg_webservices_* plugins across MokoWaaS repos.

Breaking Change

Old (Joomla 4/5):

public function onBeforeApiRoute(&$router): void

New (Joomla 6):

use Joomla\CMS\Event\Application\BeforeApiRouteEvent;

public function onBeforeApiRoute(BeforeApiRouteEvent $event): void
{
    $router = $event->getRouter();
}

Error

Call to undefined method BeforeApiRouteEvent::createCRUDRoutes()

Scope

  • MokoWaaS (tracked as MokoWaaS#48)
  • Any Joomla repo with webservices plugins
  • May need a drift check / validator to detect old-style event handlers

Additional

Also discovered: api/templates/system/index.php must exist for Joomla 6.1 CMSApplication::isValidTemplate(). Verify in packaging/deployment.

Acceptance Criteria

  • Update MokoWaaSApi.php to use BeforeApiRouteEvent typed parameter
  • Verify api/templates/system/ is included in packages
  • Consider adding a Joomla 6 compat validator to moko-platform
## Summary Joomla 6 changed the event handler system. Plugins using `SubscriberInterface` now receive a typed event object as the first argument instead of pass-by-reference parameters. This breaks all `plg_webservices_*` plugins across MokoWaaS repos. ## Breaking Change Old (Joomla 4/5): ```php public function onBeforeApiRoute(&$router): void ``` New (Joomla 6): ```php use Joomla\CMS\Event\Application\BeforeApiRouteEvent; public function onBeforeApiRoute(BeforeApiRouteEvent $event): void { $router = $event->getRouter(); } ``` ## Error ``` Call to undefined method BeforeApiRouteEvent::createCRUDRoutes() ``` ## Scope - MokoWaaS (tracked as MokoWaaS#48) - Any Joomla repo with webservices plugins - May need a drift check / validator to detect old-style event handlers ## Additional Also discovered: `api/templates/system/index.php` must exist for Joomla 6.1 CMSApplication::isValidTemplate(). Verify in packaging/deployment. ## Acceptance Criteria - [ ] Update MokoWaaSApi.php to use BeforeApiRouteEvent typed parameter - [ ] Verify api/templates/system/ is included in packages - [ ] Consider adding a Joomla 6 compat validator to moko-platform
jmiller added the joomlaphppriority: critical labels 2026-05-26 18:33:36 +00:00
Author
Owner

Branch created: feature/164-fix-joomla6-update-webservices-plugins-f

git fetch origin
git checkout feature/164-fix-joomla6-update-webservices-plugins-f
Branch created: [`feature/164-fix-joomla6-update-webservices-plugins-f`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/164-fix-joomla6-update-webservices-plugins-f) ```bash git fetch origin git checkout feature/164-fix-joomla6-update-webservices-plugins-f ```
Author
Owner

Source issue: MokoConsulting/MokoWaaS#48
Hotfixed on live server 2026-05-26. Proper fix pending in source repo.

Source issue: MokoConsulting/MokoWaaS#48 Hotfixed on live server 2026-05-26. Proper fix pending in source repo.
Author
Owner
**Related issues:** - MokoConsulting/MokoWaaS#48 (source — hotfixed on live) - MokoConsulting/moko-platform#164 (tracking) - MokoConsulting/Template-Generic#32 - MokoConsulting/Template-Joomla#13
Author
Owner

Proof

The Joomla 6 typed event fix was applied directly in MokoWaaS (commit 3f20ad9, merged as a68e90d). MokoWaaS#48 is closed.

A Joomla 6 compatibility validator for CI would be a separate feature request if needed.

## Proof The Joomla 6 typed event fix was applied directly in MokoWaaS (commit 3f20ad9, merged as a68e90d). MokoWaaS#48 is closed. A Joomla 6 compatibility validator for CI would be a separate feature request if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/moko-platform#164