mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Misleading error message in SSViewer
Better error message if theme is disabled DRY!
This commit is contained in:
parent
a77ca1995a
commit
998c055676
@ -778,12 +778,14 @@ class SSViewer implements Flushable {
|
|||||||
if(!$this->chosenTemplates) {
|
if(!$this->chosenTemplates) {
|
||||||
$templateList = (is_array($templateList)) ? $templateList : array($templateList);
|
$templateList = (is_array($templateList)) ? $templateList : array($templateList);
|
||||||
|
|
||||||
user_error(
|
$message = 'None of the following templates could be found';
|
||||||
"None of these templates can be found in theme '"
|
if(!$theme) {
|
||||||
. Config::inst()->get('SSViewer', 'theme') . "': "
|
$message .= ' (no theme in use)';
|
||||||
. implode(".ss, ", $templateList) . ".ss",
|
} else {
|
||||||
E_USER_WARNING
|
$message .= ' in theme "' . $theme . '"';
|
||||||
);
|
}
|
||||||
|
|
||||||
|
user_error($message . ': ' . implode(".ss, ", $templateList) . ".ss", E_USER_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user