From 14337b26a8fc502aa85784357e702a35bb64f229 Mon Sep 17 00:00:00 2001 From: Jebb Domingo Date: Thu, 20 Nov 2025 17:41:35 +0800 Subject: [PATCH 1/2] #717 Always use frontend template for template override - Hard code client id to ensure the query always targets the site client. - getClientId() is non-existent in ConsoleApplication --- .../joomlatools/component/koowa/template/locator/component.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/libraries/joomlatools/component/koowa/template/locator/component.php b/code/libraries/joomlatools/component/koowa/template/locator/component.php index 566e16ba8..fa9c01f8c 100644 --- a/code/libraries/joomlatools/component/koowa/template/locator/component.php +++ b/code/libraries/joomlatools/component/koowa/template/locator/component.php @@ -51,7 +51,7 @@ protected function _initialize(KObjectConfig $config) ->columns('template') ->where('client_id = :client_id AND home = :home') ->bind(array( - 'client_id' => JFactory::getApplication()->getClientId(), 'home' => 1 + 'client_id' => 0, 'home' => 1 )); $template = $this->getObject('database')->select($query, KDatabase::FETCH_FIELD); From 15400ce4f4f684c66d027775b154a3e2fea3989f Mon Sep 17 00:00:00 2001 From: Jebb Domingo Date: Fri, 21 Nov 2025 10:57:49 +0800 Subject: [PATCH 2/2] #717 Use frontend template for CLI application Replaces the hardcoded client_id with a dynamic value based on the application context (CLI or not) when querying for the default template. --- .../joomlatools/component/koowa/template/locator/component.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/libraries/joomlatools/component/koowa/template/locator/component.php b/code/libraries/joomlatools/component/koowa/template/locator/component.php index fa9c01f8c..7456974ee 100644 --- a/code/libraries/joomlatools/component/koowa/template/locator/component.php +++ b/code/libraries/joomlatools/component/koowa/template/locator/component.php @@ -46,12 +46,13 @@ protected function _initialize(KObjectConfig $config) { if(defined('JPATH_THEMES')) { + $client_id = JFactory::getApplication()->isClient('cli') ? 0 : JFactory::getApplication()->getClientId(); $query = $this->getObject('database')->getQuery('select') ->table('template_styles') ->columns('template') ->where('client_id = :client_id AND home = :home') ->bind(array( - 'client_id' => 0, 'home' => 1 + 'client_id' => $client_id, 'home' => 1 )); $template = $this->getObject('database')->select($query, KDatabase::FETCH_FIELD);