Multiselect Bug in the backend

In Magento version < it is not possible to empty a multiselect.

In the adminbackend in Magento is a bug, which prevents a multiselect to become empty.


A <select> element is not submited, if no option is selected. To submit a value you need to render a <input type="hidden" /> element before it. This way, the variable is set in $_GET or $_POST and may be overwritten by the <select>.

Bug in magento

This <input type="hidden" /> is not rendered before Version


Thanks to this thread I found a quick, good fix (as magento fixed it in versions >

// app/code/core/Mage/Adminhtml/Block/Widget/Form.php:203
} else if ($inputType == 'multiselect') {
	$element->setValues($attribute->getSource()->getAllOptions(false, true));
	$element->setCanBeEmpty(true); // add this line

The line number is from version