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