avstudnitz/AvS_FastSimpleImport

strtolower issue with dropdown/multiselect attributes

infabo opened this issue · 2 comments

This is a breaker:

? $attrParams['options'][Mage::helper('fastsimpleimport')->strtolower($rowData[$attrCode])]

If available, mb_strtolower is used instead of PHP strtolower.
See here:

https://github.com/avstudnitz/AvS_FastSimpleImport/blob/develop/src/app/code/community/AvS/FastSimpleImport/Helper/Data.php#L23

But ImportExport uses PHP strtolower for "getAttributeOptions":

https://github.com/firegento/magento/blob/magento-1.9.3.6/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php#L377

It leads to a PHP notice and an not imported attribute value - when the option contains "Umlaute".

Notice: Undefined index: überspannungsschutz in /var/www/xyz/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Product/Type/Simple.php on line 33

Attribute Option (actual value): Überspannungsschutz

$str = 'Überspannungsschutz';
strtolower($str) => Überspannungsschutz
mb_strtolower($str, mb_detect_encoding($str)) => überspannungsschutz

So my question to the original author of these lines

? $attrParams['options'][Mage::helper('fastsimpleimport')->strtolower($rowData[$attrCode])]

and or the helper fuction:
Why was it needed?

Duplicate of #395

OK, it's the same problem - but #395 is a PR. So no duplicate. But we can discuss over there (instead of here, because discussing over at a - at least questionable PR - is much more valuable...nvm)