View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006221 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2015-08-31 15:44 | 2015-11-06 12:21 |
Reporter | s.krenz | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.9.5 / 5.2.5 | ||||
Fixed in Version | 4.9.7 / 5.2.7 | ||||
Summary | 0006221: OXID loads an incorrect manufacturer | ||||
Description | If the table `oxmanufacturers` contains entries with simple integers as OXID and one or more entries where the OXID starts with one of these integers, the wrong manufacturer will be loaded. | ||||
Steps To Reproduce | The order in which the entries are added is important. The 2nd one must be later returned by MySQL than the 1st one. 1. Create an entry in `oxmanufacturers` with the following data: OXID => "10acbdef" OXSHOPID => 'oxbaseshop' OXACTIVE => 1 OXTITLE => "DEF" 2. Create a second entry in `oxmanufacturers` with the following data: OXID => "10" OXSHOPID => 'oxbaseshop' OXACTIVE => 1 OXTITLE => "ABC" 3. Open the "By Manufacturer" page for the 1st manufacturer. | ||||
Additional Information | This problem happens because of PHP's type casting during checking conditions. File: application/models/oxmanufacturerlist.php Line: 126 If the bug occures the "$sActCat" and "$sVndId" variables are casted into integers because "$sVndID" is "10" (it will be interpreted as the integer 10 by PHP) and "10abcdef" will be converted to the integer 10 too. | ||||
Tags | Solution Provided | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
Created a hotfix and sent a pull request on GitHub: https://github.com/OXID-eSales/oxideshop_ce/pull/254 |
|
see examples on http://php.net/manual/de/language.types.string.php#language.types.string.conversion for an explanation on PHP's behaviour. |
|
Of cause, the fifth to eigth example shows the problem. |
|
Pull Request accepted with type casting to string upgrade. |