View Issue Details

IDProjectCategoryView StatusLast Update
0005812OXID eShop (all versions)4.07. Source code, Testpublic2024-09-16 15:17
ReporterClemensSahs Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version4.6.8 
Summary0005812: $iLinkType is not exists in oxSimpleVariant::getBaseStdLink
Descriptionthis code looks like a copy/parse from oxSimpleVariant::getStdLink

https://github.com/OXID-eSales/oxideshop_ce/blob/b-dev-ce/source/application/models/oxsimplevariant.php#L333-L343
Additional InformationAffected methods:

\OxidEsales\EshopCommunity\Application\Model\SimpleVariant::getBaseStdLink
\OxidEsales\EshopCommunity\Application\Model\SimpleVariant::getBaseSeoLink
TagsVariants
Attached Files
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Relationships

has duplicate 0005813 closedQA oxsimplevariant $iLang param not as optional 

Activities

ClemensSahs

2014-07-08 15:42

reporter   ~0010002

same situation in:
- oxSimpleVariant::getBaseSeoLink

SvenBrunk

2024-09-16 15:17

administrator   ~0017538

Last edited: 2024-09-16 15:17

I just had an interesting conversation about this with our Core team and this will be refactored in a future release.
This is not really a bug (although it is a bit dirty).
It acts as a kind of request cache for getBaseStdLink for the SimpleVariant class.
The first time in a request this is called, $iLinkType is indeed undefined which makes the condition true.
This leads to the variable being set so the next call within this class will result in a skip of this part, because null is indeed a valid array key for PHP.
Of course this will lead to a PHP warning anyway.