View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002676 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2011-04-01 10:11 | 2012-12-07 14:28 |
Reporter | asarturas | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.4.5 revision 31315 | ||||
Fixed in Version | 4.5.3 revision 39087 | ||||
Summary | 0002676: Sometimes oxArticle::getLink() method returns wrong url for variant | ||||
Description | See steps for reproduce. | ||||
Steps To Reproduce | 1. Load product variant with language=1 2. Print variant url using oxArticle::getLink() method (without params) 3. Load the same variant in another variable with language=0 4. Print out this new variable url using oxArticle::getLink() method (without params) Expected results: First print (Step.2) returns url for language=1, Second print (Step.4) returns url for language=0. What happens instead: First print (Step.2) returns url for language=1, Second print (Step.4) also returns url for language=1. Sample code to reproduce bug: // test urls - en $oArticleEn = oxNew('oxarticle'); $oArticleEn->setLanguage(1); $oArticleEn->Load('%ARTICLE-VARIANT-ID%'); var_dump($oArticleEn->oxarticles__oxtitle->value, $oArticleEn->getLink()); // test urls - de $oArticleDe = oxNew('oxarticle'); $oArticleDe->setLanguage(0); $oArticleDe->Load('%ARTICLE-VARIANT-ID%'); var_dump($oArticleDe->oxarticles__oxtitle->value, $oArticleDe->getLink()); die(); | ||||
Additional Information | Possible hotfix: In sample code instead of $oArticleDe->getLink(); use $oArticleDe->getLink($oArticleDe->getLanguage()); | ||||
Tags | Products | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
P.S. hotfix of issue 0002673 (https://bugs.oxid-esales.com/view.php?id=2673) does not fixes that. |
|
This issue is related to 0002673 If you do the same 4 steps, which are described above, but print long description instead of link, then you'll see that behaviour is the same for this field. The problem there is because in oxArticle::getParentArticle() method it caches loaded parents in array, which values are distinguished only by parent_id, so if there is already parent loaded with language=1 and same parent with language=0 is required for this variant, it will not be loaded from db, but already cached parent with language=1 will be returned. |
|
@developers: check from source code side if such issue still exist and if offered solution is correct. |