View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007049 | OXID eShop (all versions) | 4.01. Database handling | public | 2019-11-08 16:41 | 2019-11-19 08:12 |
Reporter | timwetter | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Product Version | 6.2.0-beta.1 | ||||
Summary | 0007049: DB 'NULL' value for DB float/double types not possible | ||||
Description | always '0' is saved to DB instead of 'NULL' - create an extra field 'OXNIX' as 'float' DEFAULT NULL in DB table (e.g. oxcountry) - init all 'OXNIX' with 'NULL' - add to /Apllication/Controller/Admin/CountryMain.php: ---%<------%<------%<------%<------%<------%<------%<------%<------%<------%<--- public function save() { ... -- $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); ++ $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); ++ $aParams[oxcountry__oxnix] = null; ....} ---%<------%<------%<------%<------%<------%<------%<------%<------%<------%<--- - go to the backend - select a country - press 'save' button - value of OXNIX is set to '0' in DB possible solution: ---%<------%<------%<------%<------%<------%<------%<------%<------%<------%<--- - file: /Core/Model/BaseModel.php protected function _setFieldData(...) {... -- if ($isPropertyLoaded && isset($this->$longFieldName->fldtype) && $this->$longFieldName->fldtype == 'double' ) { ++ if ($isPropertyLoaded && isset($this->$longFieldName->fldtype) && $this->$longFieldName->fldtype == 'double' && $fieldValue !== null ) { ...} ---%<------%<------%<------%<------%<------%<------%<------%<------%<------%<--- I think the following str_replace function inside the if-statement causes this?! | ||||
Tags | No tags attached. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | 7.1 | ||||
Database Version | Not defined | ||||
|
Can‘t reproduce the behavior. If I add a new column with type float NULL and add as described: \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $aParams[oxcountry__oxnix] = 2; Then I have OXINIX 2 in the field. If I changed the line to save with null afterwards, I also get NULL in the database field. It seems to be more of a DB problem/configuration/non-supported DB. Can you reproduce that with 6.1.x? -MF |