View Issue Details

IDProjectCategoryView StatusLast Update
0002903OXID eShop (all versions)4.05. Performancepublic2012-12-10 13:29
Reportertjungcl Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product VersionPast development 
Fixed in Version4.5.3 revision 39087 
Summary0002903: assigning stock loads variants as side effect
Description

in oxarticle function assignstock:

[...]
        //setting to non buyable when variant list is empty (for example not loaded or inactive) and $this is non buyable parent
        if ($this->_blNotBuyableParent && count($this->getVariants()) == 0) {
            $this->_blNotBuyable = true;
        }
[...]

The comment says: when the list is empty (for example not loaded).
In fact the call to getVariants() loads the variants, so if it was not loaded (on purpose) it gets now.
More: if $this->_blNotBuyable is already true, it must not be checked.

so, do get the same result without forcing a variantload, change to

        //setting to non buyable when variant list is empty (for example not loaded or inactive) and $this is non buyable parent
        if (!$this->_blNotBuyable && $this->_blNotBuyableParent && $this->oxarticles__oxvarcount->value == 0) {
            $this->_blNotBuyable = true;
        }

TagsPerformance
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

birute_meilutyte

2011-05-19 14:04

reporter   ~0004618

@developers: check from source code side if such issue still exist and if offered solution is ok.

arvydas_vapsva

2011-08-26 10:20

reporter   ~0005122

thnx! great hint!