[*] CORE : Throw Exception when no theme selected
This commit is contained in:
@@ -66,14 +66,15 @@ class PrestaShopExceptionCore extends Exception
|
||||
echo '<b>'.((isset($trace['class'])) ? $trace['class'] : '').((isset($trace['type'])) ? $trace['type'] : '').$trace['function'].'</b>';
|
||||
echo ' - <a href="#" style="font-size: 12px; color: #000000" onclick="document.getElementById(\'psTrace_'.$id.'\').style.display = (document.getElementById(\'psTrace_'.$id.'\').style.display != \'block\') ? \'block\' : \'none\'; return false">[line '.$current_line.' - '.$relative_file.']</a>';
|
||||
|
||||
if (count($trace['args']))
|
||||
if (isset($trace['args']) && count($trace['args']))
|
||||
echo ' - <a href="#" onclick="document.getElementById(\'psArgs_'.$id.'\').style.display = (document.getElementById(\'psArgs_'.$id.'\').style.display != \'block\') ? \'block\' : \'none\'; return false">['.count($trace['args']).' Arguments]</a>';
|
||||
else
|
||||
echo ' - <span style="font-size: 12px;">[0 Argument]</a>';
|
||||
|
||||
if ($relative_file)
|
||||
$this->displayFileDebug($trace['file'], $trace['line'], $id);
|
||||
$this->displayArgsDebug($trace['args'], $id);
|
||||
if (isset($trace['args']) && count($trace['args']))
|
||||
$this->displayArgsDebug($trace['args'], $id);
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
|
||||
@@ -93,13 +93,15 @@ $context = Context::getContext();
|
||||
try
|
||||
{
|
||||
$context->shop = Shop::initialize();
|
||||
if (Tools::isEmpty($theme_name = $context->shop->getTheme()) || !file_exists(_PS_ALL_THEMES_DIR_.$theme_name))
|
||||
throw new PrestaShopException('No theme selected');
|
||||
}
|
||||
catch (PrestaShopException $e)
|
||||
{
|
||||
$e->displayMessage();
|
||||
}
|
||||
|
||||
define('_THEME_NAME_', $context->shop->getTheme());
|
||||
define('_THEME_NAME_', $theme_name);
|
||||
define('__PS_BASE_URI__', $context->shop->getBaseURI());
|
||||
|
||||
/* Include all defines related to base uri and theme name */
|
||||
|
||||
Reference in New Issue
Block a user