View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006767 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2018-01-12 11:15 | 2024-05-08 08:07 |
Reporter | henrik.steffen | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 6.0.0 | ||||
Fixed in Version | 6.1.0 | ||||
Summary | 0006767: Lazy loading problem with __isset() in BaseModel.php | ||||
Description | We've noticed that the behavior in lazy loading somehow changed comparing PHP 5.6 and PHP 7. It can happen that isset() gives NULL if the specified variable has never been accessed before. Obviously OXID developers also noticed the problem, because in function getCustomVAT() from OXID version 4.10.6 to 6.0.0 the code was changed from: public function getCustomVAT() { if (isset($this->oxarticles__oxvat->value)) { return $this->oxarticles__oxvat->value; } } into: public function getCustomVAT() { if ($this->__isset('oxarticles__oxvat') || $this->__get('oxarticles__oxvat')) { return $this->oxarticles__oxvat->value; } } This solves the problem for the oxvat ONLY - However, we would suggest to apply this patch not here but directly in the BaseModel.php by adding a __get to the __isset function... changing it from: return isset($this->$variableName); return isset($this->$variableName) === true || $this->__get($variableName); This would make sure, all occurencies of __isset() in the code would work as expected without any lazy loading issues. | ||||
Tags | No tags attached. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||