Open BattleMoench opened 5 years ago
we have insufficient handling for multilanguage fields in oxshops. Looks like a bug.
line 207ff in class oxid_modules_config/Core/ConfigImport.php; method importShopsConfig
for ($i = 1; $i <= 3; $i++) { $oShop->setLanguage($i); foreach ($aOxShopSettings as $sVarName => $mVarValue) { $iPosLastChar = strlen($sVarName) - 1; $iPosUnderscore = $iPosLastChar - 1; if ($sVarName[$iPosUnderscore] == '_' && $sVarName[$iPosLastChar] == $i) { $sFiledName = substr($sVarName, 0, strlen($sVarName) - 2); $aOxShopSettings[$sFiledName] = $mVarValue; } } $oShop->assign($aOxShopSettings); $oShop->save(); }
This is more readable: https://github.com/OXIDprojects/oxid_modules_config/blob/d01f87afe0965252ae5b3ce0e845f8784fabc1f0/Core/ConfigImport.php#L207-L219
I think the loop should loop over all languages instead only going from 0-3, or does anyone see a issue with that?
we have insufficient handling for multilanguage fields in oxshops. Looks like a bug.
line 207ff in class oxid_modules_config/Core/ConfigImport.php; method importShopsConfig
for ($i = 1; $i <= 3; $i++) { $oShop->setLanguage($i); foreach ($aOxShopSettings as $sVarName => $mVarValue) { $iPosLastChar = strlen($sVarName) - 1; $iPosUnderscore = $iPosLastChar - 1; if ($sVarName[$iPosUnderscore] == '_' && $sVarName[$iPosLastChar] == $i) { $sFiledName = substr($sVarName, 0, strlen($sVarName) - 2); $aOxShopSettings[$sFiledName] = $mVarValue; } } $oShop->assign($aOxShopSettings); $oShop->save(); }