View Issue Details

IDProjectCategoryView StatusLast Update
0006500OXID eShop (all versions)2.4. Administer productspublic2016-09-19 12:25
ReporterPaulius.Kupetis Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version4.9.5 / 5.2.5 
Summary0006500: Wrong category parent is shown on cateogry list
DescriptionIn category list wrong category was selected. Why this happens in example: This was because parent category ID was '003' and other category ID was '03'. And then '==' comparison tries to compare these strings, it interprets them like a numbers.
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP Version5.6
Database VersionNot defined

Activities

QA

2016-09-07 15:02

administrator   ~0011766

Thank you for submitting this entry!

Unfortunately I can't reproduce this issue. Please provide a more detailed list of steps how to reproduce it.

Paulius.Kupetis

2016-09-09 07:31

reporter   ~0011771

Last edited: 2016-09-09 07:32

This fault was on shop backend: "Administer products"->"Categories"->"Main"
And "Subcategory of" was selected wrong.
This was an issue because category parent ID was '003' and other random category ID in list was '03' and then searching for parent, other category (not true parent of category) with ID '03' was selected.
You can try to reproduce this by creating categories with ID '03', name 'good Parent' and '003' wtih name 'bad category parent'
Select any category and assign parent category with ID '03', then try to look for error.
If it still don't show up this may be because category with ID '03' is in front of list, before category with ID '003' and check passes.

Fault is in \oxAdminDetails::_getCategoryTree line : "if ($oCategory->getId() == $sSelectedCatId) {"

This line interprets '003' and '03' as same, and check passes although it should not.

QA

2016-09-09 09:24

administrator   ~0011772

The shop works with strings as unique IDs. This can be seen in the method \oxUtilsObject::generateUId where the "oxids" are generated. You will get anytime a hash of 32 chars. Using integers as oxids is not supported inherently.
So if its the requirement in the project to use integers as value for the column oxid, the shop framework needs to be adapted project specifically.

robert blank

2016-09-19 12:25

reporter   ~0011792

IMHO this is a bug, as the two OXIDs in the example are definitely strings and unique IDs.
In the comparison in the code the two strings are treated as integers and thus they are considered as equal, when they are actually not equal.
This code is fixed in pull request https://github.com/OXID-eSales/oxideshop_ce/pull/482