[*] CORE : Throw Exception when no theme selected only in front office
This commit is contained in:
1 parent
7261490381
commit
d46feffcf1
2 files changed
+3
-4
No files matched your search
@@ -162,7 +162,7 @@ class FrontControllerCore extends Controller
|
|||||||
|
|
||||||
/* Theme is missing */
|
/* Theme is missing */
|
||||||
if (!is_dir(_PS_THEME_DIR_))
|
if (!is_dir(_PS_THEME_DIR_))
|
||||||
die(sprintf(Tools::displayError('Current theme unavailable "%s". Please check your theme directory name and permissions.'), basename(rtrim(_PS_THEME_DIR_, '/\\'))));
|
throw new PrestaShopException((sprintf(Tools::displayError('Current theme unavailable "%s". Please check your theme directory name and permissions.'), basename(rtrim(_PS_THEME_DIR_, '/\\')))));
|
||||||
|
|
||||||
if (Configuration::get('PS_GEOLOCATION_ENABLED'))
|
if (Configuration::get('PS_GEOLOCATION_ENABLED'))
|
||||||
if (($newDefault = $this->geolocationManagement($this->context->country)) && Validate::isLoadedObject($newDefault))
|
if (($newDefault = $this->geolocationManagement($this->context->country)) && Validate::isLoadedObject($newDefault))
|
||||||
|
|||||||
@@ -93,14 +93,13 @@ $context = Context::getContext();
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
$context->shop = Shop::initialize();
|
$context->shop = Shop::initialize();
|
||||||
if (Tools::isEmpty($theme_name = $context->shop->getTheme()) || !file_exists(_PS_ALL_THEMES_DIR_.$theme_name))
|
if (Tools::isEmpty($theme_name = $context->shop->getTheme()) && !defined('_PS_ADMIN_DIR_'))
|
||||||
throw new PrestaShopException('No theme selected');
|
throw new PrestaShopException(Tools::displayError('Current theme unselected. Please check your theme configuration.'));
|
||||||
}
|
}
|
||||||
catch (PrestaShopException $e)
|
catch (PrestaShopException $e)
|
||||||
{
|
{
|
||||||
$e->displayMessage();
|
$e->displayMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
define('_THEME_NAME_', $theme_name);
|
define('_THEME_NAME_', $theme_name);
|
||||||
define('__PS_BASE_URI__', $context->shop->getBaseURI());
|
define('__PS_BASE_URI__', $context->shop->getBaseURI());
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user