I'm attempting to create a new product via an install script, but running into some issues, more specifically when trying to save the product.

The error I'm getting is: Call to a member function getStoreIds() on a non-object

I've isolated the error to when the product saves (see below)

When saving the product the function _saveAttributeValue is called from Mage_Catalog_Model_Resource_Abstract

Within this function the following line is throwing an error $storeIds = Mage::app()->getStore($storeId)->getWebsite()->getStoreIds(true);

This is because when calling Mage::app()->getStore() from an installer script 0 is returned instead of proper store (see: Install script to get access to root category id)

Is there any way around this where I can the product to save

1 Answer 1



  • it solves the immediate error but then causes a Invalid category IDs. while saving the product since $store->getRootCategoryId() returns null
    – pzirkind
    Commented Jul 29, 2014 at 0:29
  • my mistake it seems that another module is causing this error, will look at it soon
    – pzirkind
    Commented Jul 29, 2014 at 13:45
  • thanks! the other error was being triggered by a 3rd party module extending the backend model for entity_attribute
    – pzirkind
    Commented Jul 29, 2014 at 19:02

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.