3

I found that CatalogInventory/Model/Stock/Item model doesn't trigger _beforeSave() method of it's parent. So, we cannot observe models save_before event. Is it special for preventing from hooks or some bug? Do it leads to some problems or nor if I add parent::_saveBefore() line within the method.

class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract
{
    protected function _beforeSave()
    {
      //here should be parent::_saveBefore() call by Magento logic
    }
}
4

I think it is a bug and have reported it as such years ago. Previously the following line was included

Mage::dispatchEvent('cataloginventory_stock_item_save_before', array('item' => $this));

to make up for the missing parent::_saveBefore(). See here.

I would suggest re-instating that line if you want to observe the before save event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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