Skip to content

Commit 2d4c88b

Browse files
authored
[5.4] Template Override Count - fix (#48327)
1 parent cd8d5f8 commit 2d4c88b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

administrator/components/com_templates/src/Model/TemplateModel.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,23 @@ public function getUpdatedList($state = false, $all = false, $cleanup = false)
181181

182182
$template = $this->getTemplate();
183183

184-
$query->from($db->quoteName('#__template_overrides', 'a'));
184+
$query->from($db->quoteName('#__template_overrides', 'a'))
185+
->join(
186+
'INNER',
187+
$db->quoteName('#__extensions', 'e')
188+
. ' ON ' . $db->quoteName('e.extension_id') . ' = ' . $db->quoteName('a.extension_id')
189+
)
190+
->where($db->quoteName('e.enabled') . ' = 1')
191+
->where($db->quoteName('e.type') . ' = ' . $db->quote('template'));
185192

186193
if (!$all) {
187194
$teid = (int) $template->extension_id;
188-
$query->where($db->quoteName('extension_id') . ' = :teid')
195+
$query->where($db->quoteName('a.extension_id') . ' = :teid')
189196
->bind(':teid', $teid, ParameterType::INTEGER);
190197
}
191198

192199
if ($state) {
193-
$query->where($db->quoteName('state') . ' = 0');
200+
$query->where($db->quoteName('a.state') . ' = 0');
194201
}
195202

196203
$query->order($db->quoteName('a.modified_date') . ' DESC');

0 commit comments

Comments
 (0)