refactor: Joomla-7 forward-compatibility (replace deprecated Factory accessors & jexit) #84
Reference in New Issue
Block a user
Delete Branch "dev"
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
Follow-up to PR #83. Replaces APIs deprecated in Joomla 5 and slated for removal in Joomla 7. The extension already runs cleanly on Joomla 6 — this future-proofs it for 7.
Factory::getDbo()→Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class)(uniform across plugins, controllers, static helpers, install script — works in every context without per-class trait assumptions)Factory::getUser()→Factory::getApplication()->getIdentity()Factory::getSession()→Factory::getApplication()->getSession()jexit(Text::_('JINVALID_TOKEN'))→throw new \RuntimeException(..., 403)— consistent with the access-denied checks already present in those controllers (uses PHP 8 throw-expressions to keep the one-line short-circuit form)All changed PHP files pass
php -l. No behavior change on Joomla 6.Note
The earlier SQL update-version concern is already resolved: the release bumped to
01.05.00, which matches the01.05.00.sqlupdate slot.🤖 Generated with Claude Code
Removes accessors deprecated in Joomla 5 and slated for removal in 7 (extension already runs on 6; this future-proofs for 7): - Factory::getDbo() -> Factory::getContainer()->get(DatabaseInterface::class) across plugins, controllers, static helpers, and the install script - Factory::getUser() -> Factory::getApplication()->getIdentity() - Factory::getSession() -> Factory::getApplication()->getSession() - jexit(Text::_('JINVALID_TOKEN')) -> throw new \RuntimeException(..., 403), consistent with the access-denied checks already in those controllers Note: SQL update-version concern is already resolved — the release bumped to 01.05.00, which matches the 01.05.00.sql update slot.