Magento 1.6 clear multiselect bug

Magento 1.6.0.0 and 1.6.1.0 appear to contain a nasty bug that makes it impossible to clear all values assigned to an attribute.
In older versions of Magento there was an “empty” option that you could select to clear the selection.

A quick and dirty fix would be to add this;

$html .= $this->_optionToHtml('', ''); 

right before

$value = $this->getValue();

around line 62 of the file /lib/Varien/Data/Form/Element/Multiselect.php

This however is a quick fix with two notes;
1. If you don’t expect this thing to be fixed in the next upgrade you install, make a copy of the file in /app/code/local or make a patch. Because if you don’t, the fix will be overwritten on upgrade and the bug will reappear if the Magento team ignores to fix it.
2. The actual problem is not caused in this file, it was however the easiest way to fix it. So when I have the time I will make a better fix. This should however work without side effects.

8 thoughts on “Magento 1.6 clear multiselect bug

  1. So far this fix works great. The only downside is when you do select the empty selection and save and go back to the multiple select attribute again you will not see the empty field selected in blue like you would if you were to have selected an actual option. This can cause confusion when you are duplicating products and not sure if there is a selection chosen or not. Magento 1.6.2 has just been released and this bug is not fixed in that version. It will only be fixed once 1.7 is officially released. Is there any way that you can see fixing this bug to work again in its true proper form??? I am looking to stick on a magento version and not have to keep upgrading just so I can fix some bugs to be reintroduced to new ones. Im liking 1.6 and am hoping to stick with it. :) Thanks again.

  2. I’m seeing a very weird issue with multi select option in 1.6. If I try to select more than 87 options for the multi select attribute, only 87 will be saved. Is this something everyone is hitting or specific to my magento installation. If you find a work around, please let me know.

    Thanks for your help.

      • I just have one product created. It is a simple product type and attribute name is City with 123 multi select options.

        All the 123 options are visible for this attribute in Admin panel, while creating the product, but if the Admin selects more than 87 options. only 87 will be saved.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>