Fix: register template asset manifest in offline page context
Some checks failed
Repo Health / Access control (push) Failing after 1s
Repo Health / Release configuration (push) Has been skipped
Repo Health / Scripts governance (push) Has been skipped
Repo Health / Repository health (push) Has been skipped

Joomla does not auto-load joomla.asset.json for offline.php,
causing 'unable to detect manifest' errors. Explicitly register
the registry file before using any WAM assets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-16 18:50:36 -05:00
parent a43f72bdb7
commit 8cfa184f6c

View File

@@ -30,6 +30,12 @@ $wa = $doc->getWebAssetManager();
$params = $this->params ?: $app->getTemplate(true)->params;
$direction = $this->direction ?: 'ltr';
// Register the template's asset manifest (not auto-loaded in offline context)
$manifestPath = JPATH_ROOT . '/media/templates/site/' . $this->template . '/joomla.asset.json';
if (is_file($manifestPath)) {
$wa->getRegistry()->addRegistryFile($manifestPath);
}
/* -----------------------
Load assets via WebAssetManager (matches index.php pattern)
------------------------ */