fix: set package client_id to 0 (site) for update matching
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 2s
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Generic: Repo Health / Access control (pull_request) Successful in 2s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 7s
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 7s
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Successful in 9s
Universal: Auto Version Bump / Version Bump (push) Successful in 13s
Universal: PR Check / Validate PR (pull_request) Failing after 11s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 10s
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Has been cancelled
Joomla: Extension CI / PHPStan Analysis (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report Issues (pull_request) Has been cancelled

Joomla packages must have client_id=0 in #__extensions for the
updater to match against <client>site</client> in updates.xml.
The package was incorrectly registered with client_id=1 (admin),
causing updates to be invisible in the Joomla update manager.

Adds fixPackageClientId() to postflight so it self-corrects on
every install/update.
This commit is contained in:
Jonathan Miller
2026-06-15 00:34:54 -05:00
parent dc1089e6bf
commit 79e577edf0
+20
View File
@@ -145,6 +145,10 @@ class Pkg_MokoSuiteBackupInstallerScript
// (Joomla may not add new submenu entries or update params on upgrades)
$this->ensureSubmenuItems();
// Fix package client_id — packages must be client_id=0 (site) for
// Joomla's updater to match the <client>site</client> in updates.xml
$this->fixPackageClientId();
// Sync submenu icons in #__menu (Joomla doesn't update icons on upgrades)
$this->syncMenuIcons();
@@ -478,6 +482,22 @@ class Pkg_MokoSuiteBackupInstallerScript
}
}
private function fixPackageClientId(): void
{
try {
$db = Factory::getDbo();
$query = $db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('client_id') . ' = 0')
->where($db->quoteName('element') . ' = ' . $db->quote('pkg_mokosuitebackup'))
->where($db->quoteName('type') . ' = ' . $db->quote('package'));
$db->setQuery($query);
$db->execute();
} catch (\Exception $e) {
error_log('MokoSuiteBackup: fixPackageClientId() failed: ' . $e->getMessage());
}
}
private function syncMenuIcons(): void
{
$iconMap = [