plg_webservices_mokowaas: Update event handler for Joomla 6 API #48
Closed
opened 2026-05-26 18:28:06 +00:00 by jmiller
·
5 comments
No Branch/Tag Specified
main
9c9a1a7b52ee265d9a0e4c8dd0b93c0dd94e47bf
dev
2c0ed08368be0e0ebb311ee3f854eb38efb4b0e8
a2eaf549af2182ba5976780b491dd6d6b4c79483
feature/48-plg-webservices-mokowaas-update-event-ha
c6c9b217a1d8c815b86b1ecc4bfae87d284d06c8
43abc6514e235195c4bbf0a6ca13c16fff8ddf0d
e66b7e9a79cd7c033a4f50dc7e845136fc327cbd
fad0170cefcb404a9cd7b4e08f3cd4d1623ca0ab
65d9aa3e9fe2d94f5b29811d7c3e14587afb7adb
version/02
8c9e3e6d44d568da3475bf6d775ef28ef79be9b9
bdceb4256f0f73b12e928e67f0d271c70bb1967f
stable
alpha
beta
Labels
Clear labels
automation
breaking-change
build
ci-cd
config
css
dependencies
deploy-failure
docker
documentation
dolibarr
generic
good first issue
health-check
health: excellent
health: fair
health: good
health: poor
help wanted
html
javascript
joomla
major-release
minor-release
mokostandards
needs-review
needs-testing
patch-release
php
priority: critical
priority: high
priority: low
priority: medium
push-failure
python
regression
release-candidate
security
size/l
size/m
size/s
size/xl
size/xs
size/xxl
standards-drift
standards-update
standards-violation
status: blocked
status: in-progress
status: needs-review
status: on-hold
status: pending
status: wontfix
sync-failure
sync-report
template-validation-failure
test-failure
tests
type: bug
type: chore
type: enhancement
type: feature
type: refactor
type: release
type: test
type: version
typescript
version
version-branch
version-drift
work-in-progress
bug
chore
documentation
enhancement
feature
pending: dependency
pending: deployment
pending: design
pending: documentation
pending: feedback
pending: review
pending: testing
priority: critical
priority: high
priority: low
priority: medium
refactor
roadmap
scope: client
scope: dolibarr
scope: infrastructure
scope: joomla
scope: waas
security
status: blocked
status: duplicate
status: in-progress
status: needs-review
status: wontfix
Automated processes or scripts
Breaking API or functionality change
Build system changes
CI/CD pipeline changes
Configuration file changes
CSS/styling changes
Dependency updates
Automated deploy failure tracking
Docker configuration changes
Documentation changes
Dolibarr module or extension
Generic project or library
Good for newcomers
Repository health check results
Health score 90-100
Health score 50-69
Health score 70-89
Health score below 50
Extra attention needed
HTML template changes
JavaScript code changes
Joomla extension or component
Major version release (breaking changes)
Minor version release (XX.YY.00)
MokoStandards compliance
Awaiting code review
Requires manual or automated testing
Patch version release (XX.YY.ZZ)
PHP code changes
Critical priority, must be addressed immediately
High priority
Low priority
Medium priority
File push failure requiring attention
Python code changes
Regression from a previous working state
Release candidate build
Security-related changes
Large change (101-300 lines)
Medium change (31-100 lines)
Small change (11-30 lines)
Extra large change (301-1000 lines)
Extra small change (1-10 lines)
Extremely large change (1000+ lines)
Repository drifted from MokoStandards
MokoStandards sync update
Standards compliance failure
Blocked by another issue or dependency
Currently being worked on
Awaiting code review
Temporarily on hold
Pending action or decision
This will not be worked on
Bulk sync failure requiring attention
Bulk sync run report
Template workflow validation failure
Automated test failure
Test suite changes
Something isn't working
Maintenance tasks
Enhancement to existing feature
New feature or request
Code refactoring
Release preparation or tracking
Test suite additions or changes
Version-related change
TypeScript code changes
Version bump or release
Version branch related
Version mismatch detected
Work in progress, not ready for merge
Something is not working
Maintenance and housekeeping
Documentation improvements
Improvement to existing functionality
New feature or request
Blocked by another issue or external dependency
Tested and approved, awaiting deployment to production
Needs UI/UX or architecture design before implementation
Feature works, needs documentation/wiki update
Awaiting feedback or decision from stakeholder
Implementation complete, awaiting code review
Feature implemented but not yet tested
Must fix immediately
Should fix soon
Nice to have
Fix when convenient
Code restructuring without behavior change
Planned feature or enhancement tracked on the roadmap
Client-specific work
Dolibarr modules and customizations
Server, CI, backups, monitoring
Joomla templates and extensions
MokoWaaS platform
Security vulnerability or hardening
Waiting on external dependency
Duplicate of another issue
Being worked on
Ready for review
Will not be addressed
Milestone
No items
No Milestone
Assignees
jmiller (Jonathan Miller)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: MokoConsulting/MokoWaaS#48
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
plg_webservices_mokowaasplugin uses the Joomla 4/5 event handler signature, which is incompatible with Joomla 6's typed event system. This breaks the entire Joomla REST API on any site running this plugin on Joomla 6.Error
Root Cause
In
plugins/webservices/mokowaas/src/Extension/MokoWaaSApi.php, the handler uses the old-style pass-by-reference signature:With
SubscriberInterface, the first argument is the event object, not the router. So$routeris actually aBeforeApiRouteEventinstance, and callingcreateCRUDRoutes()on it fails.Fix
Update to use the Joomla 6 typed event API:
Current Status
mokoconsulting.tech(2026-05-26)Additional Context
A second issue was also discovered and hotfixed: the
api/templates/system/directory was missing on both live and dev servers. Joomla 6.1'sCMSApplication::isValidTemplate()requiresapi/templates/system/index.phpto exist. This should be verified in the deployment/packaging process.Acceptance Criteria
MokoWaaSApi.phpto useBeforeApiRouteEventtyped parameterBeforeApiRouteEventimportapi/templates/system/index.phpis included in package or deploymentBranch created:
feature/48-plg-webservices-mokowaas-update-event-haTracked in moko-platform as MokoConsulting/moko-platform#164
Related issues:
Fix Applied
Commit:
3f20ad9ondevChanges
src/packages/plg_webservices_mokowaas/src/Extension/MokoWaaSApi.php:use Joomla\CMS\Event\Application\BeforeApiRouteEvent;public function onBeforeApiRoute(&\): voidpublic function onBeforeApiRoute(BeforeApiRouteEvent \): void\ = \->getRouter();Remaining
api/templates/system/index.phpin package/deploymentProof
Fixed in commit
3f20ad9(dev), merged to main viaa68e90d.Changes:
Workflows also updated (paths filter removed) on both dev and main.