cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in 1.9.3.0 when saving (multiselect) attribute

Bug in 1.9.3.0 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);

to

 

...
$data['option']['value'][$key] = array_map(
                    array($helperCatalog, 'stripTags'),
                    $values,
                    array_fill(
                        0,
                        count($values),
                        $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!