View Issue Details

IDProjectCategoryView StatusLast Update
0006658OXID eShop (all versions)4. ------ eShop Core -------public2024-05-15 15:33
Reportervanilla thunder Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version4.10.2 / 5.3.2 
Summary0006658: deceptive return value by oxViewConfig::getViewThemeParam($sName)
Descriptionthis 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 Reproducejust 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 Informationsuggested fix:
core\oxviewconfig.php line 1432:

public function getViewThemeParam($sName)
{
    $sValue = null; // instead of false
    ...
}
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2017-06-29 14:30

administrator   ~0012169

Last edited: 2024-05-15 15:33

Another possible fix: Throw a specific "there isn't such a theme config param" exception. So "null" can also be used as a valid value.

-MK