View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003777 | OXID eShop (all versions) | 4.02. Session handling | public | 2012-03-28 13:43 | 2012-04-20 09:55 |
Reporter | tjungcl | Assigned To | |||
Priority | urgent | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.9 revision 43186 | ||||
Fixed in Version | 4.6.0_RC2 | ||||
Summary | 0003777: minibasket product links change language | ||||
Description | if you put something to basket in english, then change to german and put something else in the basket, the minibasket-product-links change the session language when clicking. so, opening the first product via the minibasket-link will always switch seesion-language to english, the second always will change it to german. | ||||
Tags | No tags attached. | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
Not fixed. Now changing the language with filled basket crashes the shop in an endless loop (since rev from 6.Apr.) |
|
I hope you can find and fix it soon. In the meantime, a dirty quickfix that made at least my testshop functional again. Replace the function setLanguageId in class oxbasketitem with: protected static $_loopdetect = array(); public function setLanguageId( $iLanguageId ){ if (self::$_loopdetect[$this->getProductId()]) return; self::$_loopdetect[$this->getProductId()] = true; $iOldLang = $this->_iLanguageId; $this->_iLanguageId = $iLanguageId; // 0003777: reload content on language change if ($iOldLang !== null && $iOldLang != $iLanguageId) { $this->_sTitle = null; $this->_setArticle($this->getProductId()); } self::$_loopdetect[$this->getProductId()] = false; } |
|
Reminder sent to: tjungcl Hi, we can not reproduce locally your described problem. It works as expected, changing the language minibasket links is changing, shop do not crashes. Please describe steps, for reproducing shop endless loop. |
|
Thank you for looking into this so fast. I dont have to do anything special - but we have a customized shop, so it's possible, that this is a side effect with a module. Here i put something in the basket, go to the checkout (step1) and change language --> server hangs. however, if you look in the code, the function is quite endangered of looping: - _validatebasket calls basketitem->setLanguageId (with baselang) - setLanguageId calls setArticle - setArticle calls getTitle - getTitle calls setLanguageId (with baselang) There are checks (old lang != new lang), but as soon as you have an environment in which the baselanguage is in some way modified by something else, the setLanguageId will start looping as in our case. You could make it more robust by breaking the loop-possibility completly (for example by not calling setlanguageid in gettitle but setting it directly (not tried that yet). |
|
Removed the possibility of infinity loop in basket item class. Changes made: class oxBasketItem >> call function "setLanguageId()" only in "init()" function. |