refactor: replace Joomla-7-deprecated APIs (forward compatibility)
Universal: Auto Version Bump / Version Bump (push) Successful in 12s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 15s

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.
This commit is contained in:
2026-06-28 14:47:34 -05:00
parent 77cf557b71
commit d6fb2816cf
9 changed files with 30 additions and 30 deletions
+4 -4
View File
@@ -55,7 +55,7 @@ class Pkg_MokoOGInstallerScript
if ($type === 'install')
{
$db = Factory::getDbo();
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
foreach (['system', 'content', 'webservices'] as $folder)
{
@@ -79,7 +79,7 @@ class Pkg_MokoOGInstallerScript
{
try
{
$db = \Joomla\CMS\Factory::getDbo();
$db = \Joomla\CMS\Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
$db->setQuery(
$db->getQuery(true)
->select($db->quoteName('us.extra_query'))
@@ -103,7 +103,7 @@ class Pkg_MokoOGInstallerScript
try
{
$db = \Joomla\CMS\Factory::getDbo();
$db = \Joomla\CMS\Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
$db->setQuery(
$db->getQuery(true)
->select($db->quoteName('us.update_site_id'))
@@ -133,7 +133,7 @@ class Pkg_MokoOGInstallerScript
{
try
{
$db = \Joomla\CMS\Factory::getDbo();
$db = \Joomla\CMS\Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
$db->setQuery(
$db->getQuery(true)
->select([$db->quoteName('update_site_id'), $db->quoteName('extra_query')])