Quantcast
Channel: RapidCommerce Blog » Magento
Viewing all articles
Browse latest Browse all 11

Magento 1.6 clear multiselect bug

$
0
0

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.


Viewing all articles
Browse latest Browse all 11

Trending Articles