From a22138f3c7e5e3e2d0c683d93ff35420b83eb6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 15 May 2013 16:23:29 +0200 Subject: [PATCH] // small fix for id_shop and php-cli --- classes/shop/Shop.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/shop/Shop.php b/classes/shop/Shop.php index 0648118dd..0b09fa31d 100644 --- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -352,7 +352,10 @@ class ShopCore extends ObjectModel if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI()) { // If in admin, we can access to the shop without right URL - $shop = new Shop((int)Configuration::get('PS_SHOP_DEFAULT')); + if (!$id_shop) + $id_shop = (int)Configuration::get('PS_SHOP_DEFAULT'); + + $shop = new Shop((int)$id_shop); $shop->physical_uri = preg_replace('#/+#', '/', str_replace('\\', '/', dirname(dirname($_SERVER['SCRIPT_NAME']))).'/'); $shop->virtual_uri = ''; @@ -1130,4 +1133,4 @@ class ShopCore extends ObjectModel ($delete ? ' AND entity.deleted = 0' : '') ); } -} +} \ No newline at end of file