Skip to content

Commit a886532

Browse files
authored
[6.1] Align all occurancies (#46755)
1 parent eeb8829 commit a886532

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,14 @@ public function getFiles()
370370
$path = Path::clean($client->path . '/templates/' . $template->element . '/');
371371
$lang = Factory::getLanguage();
372372

373-
// Load the core and/or local language file(s).
373+
// Load the parent and child overrides for template language constants
374+
if (!empty($template->xmldata->parent)) {
375+
$lang->load('tpl_' . $template->xmldata->parent, $client->path)
376+
|| $lang->load('tpl_' . $template->xmldata->parent, $client->path . '/templates/' . $template->xmldata->parent);
377+
}
378+
374379
$lang->load('tpl_' . $template->element, $client->path)
375-
|| (!empty($template->xmldata->parent) && $lang->load('tpl_' . $template->xmldata->parent, $client->path))
376-
|| $lang->load('tpl_' . $template->element, $client->path . '/templates/' . $template->element)
377-
|| (!empty($template->xmldata->parent) && $lang->load('tpl_' . $template->xmldata->parent, $client->path . '/templates/' . $template->xmldata->parent));
378-
$this->element = $path;
380+
|| $lang->load('tpl_' . $template->element, $client->path . '/templates/' . $template->element);
379381

380382
if (!is_writable($path)) {
381383
$app->enqueueMessage(Text::_('COM_TEMPLATES_DIRECTORY_NOT_WRITABLE'), 'error');

components/com_config/src/Model/TemplatesModel.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,14 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
9191

9292
$templateObj = Factory::getApplication()->getTemplate(true);
9393

94-
// Load the core and/or local language file(s).
94+
// Load the parent and child overrides for template language constants
95+
if (!empty($templateObj->parent)) {
96+
$lang->load('tpl_' . $templateObj->parent, JPATH_BASE)
97+
|| $lang->load('tpl_' . $templateObj->parent, JPATH_BASE . '/templates/' . $templateObj->parent);
98+
}
99+
95100
$lang->load('tpl_' . $templateObj->template, JPATH_BASE)
96-
|| (!empty($templateObj->parent) && $lang->load('tpl_' . $templateObj->parent, JPATH_BASE))
97-
|| $lang->load('tpl_' . $templateObj->template, JPATH_BASE . '/templates/' . $templateObj->template)
98-
|| (!empty($templateObj->parent) && $lang->load('tpl_' . $templateObj->parent, JPATH_BASE . '/templates/' . $templateObj->parent));
101+
|| $lang->load('tpl_' . $templateObj->template, JPATH_BASE . '/templates/' . $templateObj->template);
99102

100103
// Look for com_config.xml, which contains fields to display
101104
$formFile = Path::clean(JPATH_BASE . '/templates/' . $templateObj->template . '/com_config.xml');

0 commit comments

Comments
 (0)