diff --git a/admin-dev/functions.php b/admin-dev/functions.php
index 56c7322ac..d408f5744 100644
--- a/admin-dev/functions.php
+++ b/admin-dev/functions.php
@@ -466,7 +466,10 @@ function runAdminTab($tab, $ajaxMode = false)
{
echo '
';
if (Shop::getContext() == Shop::CONTEXT_GROUP)
- printf(translate('You are configuring your store for group shop %s'), ''.Context::getContext()->shop->getGroup()->name.'');
+ {
+ $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
+ printf(translate('You are configuring your store for group shop %s'), ''.$shop_group->name.'');
+ }
elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
printf(translate('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.'');
echo '
';
diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php
index 27d46babb..371c5dcc2 100644
--- a/admin-dev/header.inc.php
+++ b/admin-dev/header.inc.php
@@ -151,8 +151,11 @@ echo '
{
if (Shop::getContext() == Shop::CONTEXT_ALL)
$youEditFieldFor = translate('A modification of this field will be applied for all shops');
- else if (Shop::getContext() == Shop::CONTEXT_GROUP)
- $youEditFieldFor = sprintf(translate('A modification of this field will be applied for all shops of group %s'), ''.Context::getContext()->shop->getGroup()->name.'');
+ elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
+ {
+ $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
+ $youEditFieldFor = sprintf(translate('A modification of this field will be applied for all shops of group %s'), ''.$shop_group->name.'');
+ }
else
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for the shop %s'), ''.Context::getContext()->shop->name.'');
echo 'hints.html(hints.html()+\'
'.addslashes($youEditFieldFor).'\');';
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 21a82f2e9..e83157f65 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -1292,7 +1292,7 @@ class AdminControllerCore extends Controller
'multi_shop' => Shop::isFeatureActive(),
'shop_list' => Helper::renderShopList(),
'shop' => $this->context->shop,
- 'shop_group' => $this->context->shop->getGroup(),
+ 'shop_group' => new ShopGroup((int)Shop::getContextShopGroupID()),
'tab' => $tab,
'current_parent_id' => (int)Tab::getCurrentParentId(),
'tabs' => $tabs,
diff --git a/classes/stock/StockAvailable.php b/classes/stock/StockAvailable.php
index 2e30feb55..83cc9d6a5 100644
--- a/classes/stock/StockAvailable.php
+++ b/classes/stock/StockAvailable.php
@@ -418,7 +418,7 @@ class StockAvailableCore extends ObjectModel
// if we are in shop_group context
if (Shop::getContext() == Shop::CONTEXT_GROUP)
{
- $shop_group = $context->shop->getGroup();
+ $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
// if quantities are shared between shops of the group
if ($shop_group->share_stock)
@@ -562,7 +562,7 @@ class StockAvailableCore extends ObjectModel
$id_shop = $context->shop->id;
// if we are in $shop_group context
- $shop_group = $context->shop->getGroup();
+ $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
// if quantities are shared between shops of the group
if ($shop_group->share_stock)
@@ -614,7 +614,7 @@ class StockAvailableCore extends ObjectModel
if (is_null($id_shop))
$id_shop = $context->shop->id;
- $shop_group = $context->shop->getGroup();
+ $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
// if quantities are shared between shops of the group
if ($shop_group->share_stock)
diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php
index 868da1ed5..4f208a3eb 100644
--- a/controllers/admin/AdminModulesController.php
+++ b/controllers/admin/AdminModulesController.php
@@ -729,7 +729,10 @@ class AdminModulesControllerCore extends AdminController
if (Shop::getContext() == Shop::CONTEXT_SHOP)
$toolbar .= 'shop '.$this->context->shop->name.'';
elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
- $toolbar .= 'all shops of group shop '.$this->context->shop->getGroup()->name.'';
+ {
+ $shop_group = new ShopGroup((int)Shop::getContextShopGroupID())
+ $toolbar .= 'all shops of group shop '.$shop_group->name.'';
+ }
else
$toolbar .= 'all shops';
$toolbar .= '