From 284fb5c07b5dc2912d5881b3747b32e1ae1e4044 Mon Sep 17 00:00:00 2001 From: Alex Hartwig Date: Thu, 28 May 2026 12:06:13 +0200 Subject: [PATCH 1/2] Fix Mantis #47841: Custom non-UI templates are ignored in skin/style --- .../ILIAS/UICore/classes/class.ilTemplate.php | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/components/ILIAS/UICore/classes/class.ilTemplate.php b/components/ILIAS/UICore/classes/class.ilTemplate.php index c26b2e22f472..231b342a713c 100755 --- a/components/ILIAS/UICore/classes/class.ilTemplate.php +++ b/components/ILIAS/UICore/classes/class.ilTemplate.php @@ -378,21 +378,24 @@ protected function getTemplatePath(string $a_tplname, string $a_in_module = ''): $style = $this->getCurrentStyle(); $base_skin_path = $ilias_root . 'public/Customizing/skin/' . $skin; - $paths = [ - "$base_skin_path/$style/components/ILIAS/UI/src", - "$base_skin_path/$style/components/ILIAS/UI", - "$base_skin_path/$style/UI/src", - "$base_skin_path/$style/UI", - "$base_skin_path/components/ILIAS/UI/src", - "$base_skin_path/components/ILIAS/UI", - "$base_skin_path/UI/src", - "$base_skin_path/UI", - ]; - - foreach ($paths as $path) { - if (is_dir($path)) { - $a_in_module = str_replace($base_skin_path . '/', '', $path); - break; + if ($a_in_module === 'components/ILIAS/UI/src') { + $paths = [ + "$base_skin_path/$style/components/ILIAS/UI/src", + "$base_skin_path/$style/components/ILIAS/UI", + "$base_skin_path/$style/UI/src", + "$base_skin_path/$style/UI", + "$base_skin_path/components/ILIAS/UI/src", + "$base_skin_path/components/ILIAS/UI", + "$base_skin_path/UI/src", + "$base_skin_path/UI", + ]; + + foreach ($paths as $path) { + if (is_dir($path)) { + $a_in_module = str_replace($base_skin_path . '/' . $style . '/', '', $path); + $a_in_module = str_replace($base_skin_path . '/', '', $a_in_module); + break; + } } } From f249e2c6abe98456541e49b48e90ef6ad0bb1e20 Mon Sep 17 00:00:00 2001 From: Alex Hartwig Date: Mon, 1 Jun 2026 19:21:53 +0200 Subject: [PATCH 2/2] Fix Mantis #47841 Part 2: Custom non-UI templates are ignored in skin/style --- .../ILIAS/UICore/classes/class.ilTemplate.php | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/components/ILIAS/UICore/classes/class.ilTemplate.php b/components/ILIAS/UICore/classes/class.ilTemplate.php index 231b342a713c..c60b5983c10d 100755 --- a/components/ILIAS/UICore/classes/class.ilTemplate.php +++ b/components/ILIAS/UICore/classes/class.ilTemplate.php @@ -380,33 +380,33 @@ protected function getTemplatePath(string $a_tplname, string $a_in_module = ''): if ($a_in_module === 'components/ILIAS/UI/src') { $paths = [ - "$base_skin_path/$style/components/ILIAS/UI/src", - "$base_skin_path/$style/components/ILIAS/UI", - "$base_skin_path/$style/UI/src", - "$base_skin_path/$style/UI", - "$base_skin_path/components/ILIAS/UI/src", - "$base_skin_path/components/ILIAS/UI", - "$base_skin_path/UI/src", - "$base_skin_path/UI", + "$base_skin_path/$style/components/ILIAS/UI/src/", + "$base_skin_path/$style/components/ILIAS/UI/", + "$base_skin_path/$style/UI/src/", + "$base_skin_path/$style/UI/", + "$base_skin_path/components/ILIAS/UI/src/", + "$base_skin_path/components/ILIAS/UI/", + "$base_skin_path/UI/src/", + "$base_skin_path/UI/", ]; foreach ($paths as $path) { - if (is_dir($path)) { - $a_in_module = str_replace($base_skin_path . '/' . $style . '/', '', $path); - $a_in_module = str_replace($base_skin_path . '/', '', $a_in_module); - break; + $ui_template_path = $path . $a_tplname; + + if ($this->fileexistsinskin($ui_template_path)) { + return $ui_template_path; } } - } - - $from_style = $base_skin_path . '/' . $style . '/' . $a_in_module . '/' . $a_tplname; - if ($this->fileexistsinskin($from_style)) { - return $from_style; - } + } else { + $from_style = $base_skin_path . '/' . $style . '/' . $a_in_module . '/' . $a_tplname; + if ($this->fileexistsinskin($from_style)) { + return $from_style; + } - $from_skin = $base_skin_path . '/' . $a_in_module . '/' . $a_tplname; - if ($this->fileexistsinskin($from_skin)) { - return $from_skin; + $from_skin = $base_skin_path . '/' . $a_in_module . '/' . $a_tplname; + if ($this->fileexistsinskin($from_skin)) { + return $from_skin; + } } return $default;