I've tried adding a new attribute to the Magento Categories which I can configure from the Admin Panel Category -> Manage Categories. The attribute is called custom_attribute.

I created a module similar to these tutorials which I followed, Atwix & ashsmith.

After completing the tutorials I can see my custom attribute on the back end from the admin panel.

But I get the below error when I try to save the category.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'custom_attribute' in 'field list'

Also I can't access the attribute from a template file with <?php $_category->getCustomAttribute() ?>, it just returns null in the debugger.

Here is my modules config.xml

<?xml version="1.0"?>

And here is my mysql4-install-0.1.0.php

$installer = $this;


$installer->addAttribute('catalog_category', 'custom_attribute', array(
    'group'             => 'General Information',
    'type'              => 'int',//can be int, varchar, decimal, text, datetime
    'backend'           => '',
    'frontend_input'    => '',
    'frontend'          => '',
    'label'             => 'Custom Attribute Label',
    'input'             => 'select', //text, textarea, select, file, image, multilselect
    'default'           => 0,  //  Set to False
    'class'             => '',
    'source'            => 'eav/entity_attribute_source_boolean',//this is necessary for select and multilelect, for the rest leave it blank
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//scope can be SCOPE_STORE or SCOPE_GLOBAL or SCOPE_WEBSITE
    'visible'           => true,
    'frontend_class'    => '',
    'required'          => false,//or true
    'user_defined'      => true,
    'position'          => 110,//any number will do

  • Did you confirm your table was created? Did you re-index? Mar 15, 2015 at 17:12
  • @brentwpeterson, Im not sure which db table to look for, what name would it have?
    – Holly
    Mar 15, 2015 at 17:14
  • 1
    @brentwpeterson, I found the attribute in the eav_attribute table. I realized that I could not re-index properly from the admin panel as it is a Magento EE install but could with php indexer.php --reindexall from the command line. Why is re-indexing done differently in EE I wonder?
    – Holly
    Mar 15, 2015 at 22:56
  • @Holy can you add this as an answer, your solution worked for me but it would be more obvious as an excepted answer. You can accept your own answer and in this case I think that would be useful
    – Luke
    Oct 8, 2015 at 20:32
  • @Luke, thanks for the feedback. I put the solution in an answer as you suggested.
    – Holly
    Oct 9, 2015 at 8:33

1 Answer 1


I was able to solve this issue by re-indexing. However with Magento EE you cannot re-index all the indexers manually from the admin panel, EE performs partial indexing for the most of the indexers by cron job, which is faster and better for performance, see Magento docs for more details.

enter image description here

So to manually re-index all of the indexers I had to re-index from the terminal, this is done with the php indexer.php --reindexall command from within the Magento shell directory.

$ cd shell/
$ php indexer.php --reindexall
Category Flat Data index was rebuilt successfully
Product Flat Data index was rebuilt successfully
Stock Status index was rebuilt successfully
Catalog product price index was rebuilt successfully
Category URL Rewrites index was rebuilt successfully
Product URL Rewrites index was rebuilt successfully
URL Redirects index was rebuilt successfully
Catalog Category/Product Index index was rebuilt successfully
Catalog Search Index index was rebuilt successfully
Tag Aggregation Data index was rebuilt successfully
Attribute Splash index was rebuilt successfully
Amasty Color Swatches Pro index was rebuilt successfully
Product Attributes index was rebuilt successfully

For more information on how to re-index from the terminal see this useful blog post from Inchoo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.