From 8cfa184f6cda63ca6f9166b84d02e74569e58069 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 16 Apr 2026 18:50:36 -0500 Subject: [PATCH] Fix: register template asset manifest in offline page context 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) --- src/offline.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/offline.php b/src/offline.php index 1d311f2..148a133 100644 --- a/src/offline.php +++ b/src/offline.php @@ -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) ------------------------ */