Showing results for 
Search instead for 
Did you mean: 

Bug in when saving (multiselect) attribute

Bug in when saving (multiselect) attribute

They changed in app\code\core\Mage\Adminhtml\controllers\Catalog\Product\AttributeController.php

from (line 182)


$data['option']['value'][$key] = array_map(array($helperCatalog, 'stripTags'), $values);



$data['option']['value'][$key] = array_map(
                    array($helperCatalog, 'stripTags'),
                        $isHtmlAllowedOnFrontend ? sprintf('<%s>', implode('><', $this->_getAllowedTags())): null

The second array that is passed to array_map destroys the keys of the array, stated in php documentation:

"The returned array will preserve the keys of the array argument if and only if exactly one array is passed. If more than one array is passed, the returned array will have sequential integer keys. "

So the array_fill is not the issue, but the second array parameter in general.

So the keys that represent store_ids get mixed up.

This is quite dangerous!