View Issue Details

IDProjectCategoryView StatusLast Update
0005852OXID eShop (all versions)4.12. Subshop handlingpublic2023-12-20 15:21
Reporterfinnegan Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status assignedResolutionopen 
PlatformLinuxOScentOSOS Version6
Product Version4.8.6 / 5.1.6 
Summary0005852: Only EE - prevent loading wrong subshop field contents in case of field content error - improve code
DescriptionI reported issue 0005081 which was closed due to non-reproducability.

Meanwhile I have found the problem for this issue: I had 1 record in the table oxfield2shop where OXID was EMPTY (maybe due to a former database problem or whatever).

Therefore in the function setProductData(...) in the oxfield2shop class the call:

 if ( $this->load( $oDb->getOne( $sQ, false, false ) ) ) {

will load a random oxfield2shop record, because $oDb->getOne( ..) will return an empty string and $this->load will load a random record.

Although this is not a bug because the field oxid of the table oxfield2shop should never be empty, you could prevent this behaviour by simply checking for oxid <> empty:

$sOxid = $oDb->getOne( $sQ, false, false );
if ($sOxid && $this->load( $sOxid ) ) {
....
Steps To Reproduce- assign some articles of the master shop to a subshop
- change the content of some subshop-dependent fields
- take a random oxfield2shop record
- manually empty the oxid field to simulate a database problem
- display articles in the subshop where no changes to subshop-dependent fields were made

Result: these articles will show the wrong content in the subshop-dependent fields (should be content of the master shop article)
TagsNo tags attached.
ThemeAll
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Relationships

has duplicate 0005081 resolvedLinas Kukulskis EE: subshop fields not assigned correctly 

Activities

There are no notes attached to this issue.