View Issue Details

IDProjectCategoryView StatusLast Update
0005910OXID eShop (all versions)1.03. Basket, checkout processpublic2014-11-11 09:07
Reporteraurimas.gladutis Assigned To 
PriorityimmediateSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.7.14 / 5.0.14 
Target Version4.8.9 / 5.1.9Fixed in Version4.8.9 / 5.1.9 
Summary0005910: When out of stock articles exists in basket and language is changed, shop for that session goes offline.
DescriptionWhen out of stock articles exists in basket and Delivery status is "if out of stock, not orderable" (have not checked with others) and language is changed, shop for that session goes offline.

This happens because unhandled exception is thrown in oxbasketitem.
Steps To Reproduce1. Go to admin and set any product's stock to 1 and Delivery Status to "if out of stock, not orderable".
2. User1: Go to frontend and add this item to basket.
3. User2: Go to frontend with different browser and buy this item (to immitate article going offline for the first user).
4. User1: change frontend language.

Shop will go offline for this user, as unhandled exception is thrown. For other users shop will still work.
Additional InformationWhen language is changed basket item is trying to reload it's info, but does not handle exceptions correctly. Problematic method is oxbasketitem::setLanguageId(), as oxbasketitem::_setArticle() throws exception when article is not buyable.
This exception is not handled and goes all the way to main exceptions handler, which causes shop to go offline for this session.
TagsStock, User Management
ThemeAzure
BrowserAll
PHP Versionany
Database Versionany

Activities

vilma_liorensaityte

2014-11-11 09:06

reporter   ~0010324

Added exception handling in oxbasketitem:setLanguageId() method when calling oxbasketitem::_setArticle():

try {
    $this->_setArticle($this->getProductId());
} catch (oxNoArticleException $oEx) {
    oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
} catch (oxArticleInputException $oEx) {
    oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx);
}