The real problem
starts in Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes
In the _prepareForm
function is a if-condition (if ($this->getAddHiddenFields())
) which ensures that the hidden fields general[id]
and general[path]
are not rendered because it always returns false
.
A bad solution would be to remove the if condition.
but as core changes are bad, is the new wonder what is getAddHiddenFields()
and why does it return false
?
The Solution (for now):
In the database table eav_attribute_group
search for an entry that matches the following query:
SELECT * FROM `eav_attribute_group` WHERE default_id = 1 AND sort_order > 1;
and Set the sort_order
to 1
The Explanation:
The answer to my first question (what is getAddHiddenFields()
):
getAddHiddenFields()
is a magic method and returns the value of the varien object field 'add_hidden_fields'
.
The Value of 'add_hidden_fields'
is set by setAddHiddenFields()
in Mage_Adminhtml_Block_Catalog_Category_Tabs->_prepareLayout()
.
For the answer to my second question (why does it always return false
) i created a little Debug log:
# Debug log of Mage_Adminhtml_Block_Catalog_Category_Tabs->_prepareLayout()
init $defaultGroupId with: 0
check group 157 is 0 or isDefault //Note 1 (see further down below)
if ($defaultGroupId(0) == 0 or $group->getIsDefault():false)
set $defaultGroupId to 157
check group 3 is 0 or isDefault
if ($defaultGroupId(157) == 0 or $group->getIsDefault():false) //Note 2 (see further down below)
check group 10 is 0 or isDefault
if ($defaultGroupId(157) == 0 or $group->getIsDefault():false)
[...]
process groupId 157
groupId 157 has no attributes
if (!$attributes) { continue; }
process groupId 3
groupId 3 has attributes
if (!$attributes) { continue; }
$active = $defaultGroupId == $group->getId();
setAddHiddenFields($active (false)))
process groupId 10
groupId 10 has attributes
if (!$attributes) { continue; }
setAddHiddenFields($active (false)))
[...]
Note 1: remember $defaultGroupId is initalized with 0 so the first entry of groupCollection would be set as default (Because of this the current solution is to set the defaultGroups sortOrder to 1)
Note 2: Oh look the nextmystery $group->getIsDefault() of group 3 returns FALSE (in my case is group 3 General and in the Database is_default = 1)
I have not tested yet, because the current solution is currently sufficient for me.