I'm trying to update an EAV attribute's default value, but the new default is not pulling through.
The attribute is
'include_in_menu' => array( 'type' => 'int', 'label' => 'Include in Navigation Menu', 'input' => 'select', 'source' => 'eav/entity_attribute_source_boolean', 'default' => '1', 'sort_order' => 10, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'group' => 'General Information', ),
Mage_Catalog_Model_Resource_Setup::getDefaultEntities() ln 325
It was added in app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-188.8.131.52.21-184.108.40.206.22.php, with the default value being '1'.
I need to set the default value to '0', and have created an update script:
<?php /* @var $this Mage_Core_Model_Resource_Setup */ $installer = $this; $installer->startSetup(); // set Include in Navigation Menu under Display Settings to default NO for new categories $installer->updateAttribute('catalog_category', 'include_in_menu', 'default_value', '0'); $installer->endSetup();
This affects the new category form, when adding a new root or sub category, but the field still defaults to 'Yes'.
There has not been any other code added to affect that field, but when I debug, when the block gets created in
Mage_Core_Model_Layout::createBlock it's returned the field is set to '1' and not '0' as expected.
Could anyone help me analyze this problem? I have checked the DB and the default value was updated by the update script, and when the attributes are loaded the default value of include_in_menu is '0'.