Skip to content

Commit

Permalink
Merge pull request #8322 from live627/error
Browse files Browse the repository at this point in the history
Pri nt the actual theme error instead of a placeholder
  • Loading branch information
live627 authored Oct 9, 2024
2 parents fea936e + 8cbc283 commit 7ded139
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public static function loadTemplate(string|bool $template_name, array|string $st
}
// Cause an error otherwise.
elseif ($template_name != 'Errors' && $template_name != 'index' && $fatal) {
ErrorHandler::fatalLang('theme_template_error', 'template', [(string) $template_name]);
ErrorHandler::fatalLang('theme_template_error', 'template', ['template_name' => (string) $template_name, 'type' => 'file']);
} elseif ($fatal) {
die(ErrorHandler::log(Lang::formatText(Lang::$txt['theme_template_error'] ?? 'Unable to load the {template_name} template file.', ['template_name' => (string) $template_name, 'type' => 'file']), 'template'));
} else {
Expand Down Expand Up @@ -416,7 +416,7 @@ public static function loadSubTemplate(string $sub_template_name, bool|string $f
if (function_exists($theme_function)) {
$theme_function();
} elseif ($fatal === false) {
ErrorHandler::fatalLang('theme_template_error', 'template', [(string) $sub_template_name]);
ErrorHandler::fatalLang('theme_template_error', 'template', ['template_name' => (string) $sub_template_name, 'type' => 'sub']);
} elseif ($fatal !== 'ignore') {
die(ErrorHandler::log(Lang::formatText(Lang::$txt['theme_template_error'] ?? 'Unable to load the {template_name} sub-template.', ['template_name' => (string) $sub_template_name, 'type' => 'sub']), 'template'));
}
Expand Down

0 comments on commit 7ded139

Please sign in to comment.