Move bridge to postflight() + add logging to update(). Bump 03.10.13
Some checks failed
Repo Health / Access control (push) Successful in 1s
Auto-Update SHA Hash / Update SHA-256 Hash in updates.xml (release) Failing after 5s
Repo Health / Release configuration (push) Failing after 3s
Repo Health / Scripts governance (push) Successful in 3s
Repo Health / Repository health (push) Failing after 4s

Joomla may not call update() for template updates. postflight() is
more reliably triggered. Also added version logging to update() to
diagnose if it's being called at all.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-19 18:28:57 -05:00
parent 85f98042d9
commit 0d14a05c61
5 changed files with 34 additions and 19 deletions

View File

@@ -97,7 +97,7 @@ class Tpl_MokocassiopeiaInstallerScript
*/
public function update(InstallerAdapter $parent): bool
{
$this->logMessage('MokoCassiopeia template updated to v03.10.00 (bridge release).');
$this->logMessage('MokoCassiopeia update() called — version ' . ($parent->getManifest()->version ?? 'unknown'));
// Run CSS variable sync to inject any new variables into user's custom palettes.
$synced = $this->syncCustomVariables($parent);
@@ -148,6 +148,21 @@ class Tpl_MokocassiopeiaInstallerScript
*/
public function postflight(string $type, InstallerAdapter $parent): bool
{
// Bridge migration runs in postflight (more reliable than update() for templates)
if ($type === 'update') {
$bridgeScript = $parent->getParent()->getPath('source') . '/helper/bridge.php';
if (!is_file($bridgeScript)) {
$bridgeScript = __DIR__ . '/helper/bridge.php';
}
if (is_file($bridgeScript)) {
require_once $bridgeScript;
if (class_exists('MokoBridgeMigration')) {
$this->logMessage('Running MokoOnyx bridge migration from postflight...');
MokoBridgeMigration::run();
}
}
}
return true;
}