View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006658 | OXID eShop (all versions) | 4. ------ eShop Core ------- | public | 2017-06-29 14:22 | 2024-05-15 15:33 |
Reporter | vanilla thunder | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 4.10.2 / 5.3.2 | ||||
Summary | 0006658: deceptive return value by oxViewConfig::getViewThemeParam($sName) | ||||
Description | this function returns false if there is no param with given $sName found, which is kind of misleading becuase of following reasons: 1) uninitialized variables are null, not false. Uninitialized config param should also be null and not false. 2) "false" is a valid data type, therefore smary modifier |default does not work with $oViewConf->getViewThemeParam($sName) 3) theme settings can also be a boolean data, in this case you can't detect if returned "false" comes from config param itself or just because there is no such config param at all | ||||
Steps To Reproduce | just put this code into any cms page and open it in browser: 1a - [{ $uninitializedVariable|@var_dump}] 1b - [{ $uninitializedVariable|default:"default value"}] 2a - [{ $oViewConf->getViewThemeParam('missingParam')|@var_dump}] 2b - [{ $oViewConf->getViewThemeParam('missingParam')|default:"default param"}] you will get output like this: 1a - NULL 1b - default value 2a - bool(false) 2b - | ||||
Additional Information | suggested fix: core\oxviewconfig.php line 1432: public function getViewThemeParam($sName) { $sValue = null; // instead of false ... } | ||||
Tags | No tags attached. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||