View Issue Details

IDProjectCategoryView StatusLast Update
0006659OXID eShop (all versions)2.3. Extensions (modules, themes)public2017-07-26 08:00
ReporterAlexN 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version6.0.0-rc.1 
Target VersionFixed in Version6.0.0-rc.2 
Summary0006659: Deactivating a module which extends basket causes shop maintenance mode
DescriptionWhen deactivating a module which extends basket (e.g. \OxidEsales\Eshop\Application\Model\Basket::class) and then deactivate the module, the backend continues to run in maintenance mode and cannot be used anymore until the module directory is renamed.

It is related to the session key "1_basket" (<shopid>_basket)) which is returned from the method "\OxidEsales\EshopCommunity\Core\Session::_getBasketName".

What exactly is happening:
For a reason I did not figured out yet there is a seralized basket object saved in the session key "1_basket" when being in the OXID eShop backend. This stores in my case instead of "[...]Basket" "[...]SofortueberweisungBasket" and is not renewed when deactivating the module. So, OXID core tries to unserialize it with a not existing class. Obviously this fails.

In OXID 4.10.4 this seems to work properly - I have made a quick check by myself using "mail(... print_r($_SESSION, true))" and the serialized object is updated accordingly.

A workaround is to unset this session key on module deactivation. However, this seems to be inappropriate as other modules probably rely on this session key.
TagsBasket, Module, Session
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2017-07-04 09:32

administrator   ~0012173

Hi, I can't reproduce this.
I made a plain extension of the basket:

oxstestbasket.php:
class oxstestbasket extends oxstestbasket_parent {}


metadata.php:
'extend' => array(
    \OxidEsales\Eshop\Application\Model\Basket::class => 'oxs/b6659/oxstestbasket'
),


Then I activated and deactivated the module. After that I could use the backend as usually.
In case I miss something, please provide a detailed step by step guide therefore I can reproduce this.

AlexN

2017-07-04 09:37

reporter   ~0012174

I have been using namespace classes provided by OXID and in my module namespaces as well. Looks like you have tested without a namespace.

Otherwise I will provide more details asap.

best regards
Alex

QA

2017-07-04 09:56

administrator   ~0012175

Reproduced.
As you wrote, a workaround is to delete the session variable during the event onDeactivate:

\OxidEsales\Eshop\Core\Registry::getSession()->delBasket();