View Issue Details

IDProjectCategoryView StatusLast Update
0005081OXID eShop (all versions)4.01. Database handlingpublic2014-08-29 15:39
Reporterfinnegan Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product Version4.7.3 / 5.0.3 revision 54408 
Summary0005081: EE: subshop fields not assigned correctly
DescriptionAs far as I can see there is a bug in the function setProductData( $oProduct ) of oxfield2shop.php.
In this function subshop data from table oxfield2shop is added to the oxarticle object if such data exist (i.e. if a record exist in oxfield2shop for the current article).

BUT if no subshop data exist (article was created in mastershop, has been assigned to 1 or more subshops, but no change to the data has been made in the subshops) a random oxfield2shop record is loaded (presumably the first record in the table) and the data is assigned to the oxarticle object.

This is because $oDb->getOne(..) returns false for "not found", and then $this->load(...) is called with false instead of OXID as parameter.
As a consequence in the load function the SQL select string is missing OXID in the WHERE clause and so a random (wrong) record is loaded into the oxfield2shop object.
Steps To Reproduce- in config.inc set $this->aMultishopArticleFields = array("OXLONGDESC", "OXSHORTDESC");
- make sure that these fields, along with their _1,_2,_3 language fields, exist in table oxfield2shop
- empty the tables oxarticles, oxartextends, oxfield2shop
- create an article x in the mastershop no 1
- enter some text in the fields oxshortdesc and oxlongdesc
- assign the article x to subshop 2
- enter some different text in the oxshortdesc and oxlongdesc fields
- create another article y in mastershop and enter some text in oxshortdesc and oxlongdex
- assign this article to subshop 2
- change to subshop2 in admin and view this article y
- in the field oxshortdesc the subshop text of ARTICLE X will show up
Additional InformationI think before calling the load() method for oxfield2shop you should check if the result from $oDb->getOne(..) contains a valid oxid for oxfield2shop.
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Relationships

duplicate of 0005852 assignedSvenBrunk Only EE - prevent loading wrong subshop field contents in case of field content error - improve code 

Activities

Linas Kukulskis

2013-05-03 15:28

reporter   ~0008666

sorry, but we unable to reproduce this case.
maybe will help some hints: after db adding field in oxfield2shop table, clean up tmp folder, and regenerate db views.

if you will have more details how to reproduce this please, reopen this bug.