View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005081 | OXID eShop (all versions) | 4.01. Database handling | public | 2013-04-22 12:52 | 2014-08-29 15:39 |
Reporter | finnegan | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | unable to reproduce | ||
Product Version | 4.7.3 / 5.0.3 revision 54408 | ||||
Summary | 0005081: EE: subshop fields not assigned correctly | ||||
Description | As 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 Information | I think before calling the load() method for oxfield2shop you should check if the result from $oDb->getOne(..) contains a valid oxid for oxfield2shop. | ||||
Tags | No tags attached. | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||