OXIDprojects / oxid_modules_config

OXID Module Configuration Im-/Exporter module by OXID Professional Services
GNU General Public License v3.0
3 stars 9 forks source link

multilanguage handling for oxshop-vars #19

Open BattleMoench opened 5 years ago

BattleMoench commented 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(); }

alfredbez commented 5 years ago

This is more readable: https://github.com/OXIDprojects/oxid_modules_config/blob/d01f87afe0965252ae5b3ce0e845f8784fabc1f0/Core/ConfigImport.php#L207-L219

keywan-ghadami-oxid commented 5 years ago

I think the loop should loop over all languages instead only going from 0-3, or does anyone see a issue with that?