Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Blank Option for Multiple Select attribute is gone. 
 
Bazz78
Sr. Member
 
Avatar
Total Posts:  156
Joined:  2008-06-16
Italy
 
furnitureforyoultd - 30 January 2012 05:03 AM

Fixed at last!

app\code\core\Mage\Adminhtml\Block\Widget\Form.php

find this section:

if ($inputType == 'select'{
                    $element
->setValues($attribute->getSource()->getAllOptions(truetrue));
                
else if ($inputType == 'multiselect'{
                    $element
->setValues($attribute->getSource()->getAllOptions(falsetrue));

replace with this:

if ($inputType == 'select'{
                    $element
->setValues($attribute->getSource()->getAllOptions(truetrue));
                
else if ($inputType == 'multiselect'{
                    $element
->setValues($attribute->getSource()->getAllOptions(truetrue));
                    
$element->setCanBeEmpty(true);

setCanBeEmpty allows you to de-select all options and save (no longer forced to have 1 selection), the change from false to true adds back the blank attribute field. If you don’t want the blank field back, keep it as false.

Pay Attention!!! I use magento 1.6.1.0 and, this solutions works well only with a single save !!!

If you use “action : Update Attributes” this reset all Multiple Select Attribute of all products even if you didn’t choose to change them!

there is a solution?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2