Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit 1f6f1e4

Browse files
make things run in oxid 6.1
in oxid 6.1 there more places where the config object is cached, to be tested for oxid 6.2
1 parent c8ffc28 commit 1f6f1e4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Core/ConfigImport.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,20 @@ protected function importConfigValues($aConfigValues)
254254
$_POST['shp'] = $sShopId;
255255
//just setting the correct shopId on this object because it is defaults to one load by config init.
256256
//doing so does not having any known effect.
257-
$oConfig->getActiveShop()->setShopId($sShopId);
258-
257+
$shop = $oConfig->getActiveShop();
258+
$shop->setShopId($sShopId);
259+
//set the global config onject in oxid 6.1
260+
$shop->setConfig($oConfig);
259261
//we need a fresh instance here because
260262
//shopId calculator is private
261263
$freshUtilsObject = new \OxidEsales\Eshop\Core\UtilsObject();
262-
Registry::set(\OxidEsales\Eshop\Core\UtilsObject::class,$freshUtilsObject);
263-
264+
Registry::set(\OxidEsales\Eshop\Core\UtilsObject::class, $freshUtilsObject);
265+
//clear oxnew cache that may hold objects like Shop class from the first run
266+
$freshUtilsObject->resetInstanceCache();
264267

265268
$ouo = Registry::get(\OxidEsales\Eshop\Core\UtilsObject::class);
266269
if($oConfig->getShopId() != $sShopId ||
267-
$oConfig->getActiveShop()->getShopId() != $sShopId ||
270+
$oConfig->getActiveShop()->getShopId() != $sShopId ||
268271
$ouo->getShopId() != $sShopId) {
269272
throw new \Exception("ShopId was not set correctly, this means shop internal have changed and import must be adapted");
270273
}

0 commit comments

Comments
 (0)