0

I am trying to re-write Mage_Core_Model_Session_Abstract_Varien class in my custom module but getting error :

Recoverable Error: Argument 1 passed to Mage_Core_Block_Messages::addMessages() must be an instance of Mage_Core_Model_Message_Collection

What I have tried -

config.xml

<core>
      <rewrite>
           <session>Test_HelloDeveloper_Model_Product</session>
       </rewrite>
</core>

And ...Model/Product.php

class Test_HelloDeveloper_Model_Product extends Mage_Core_Model_Session_Abstract_Varien {

    public function start($sessionName=null)
    {
        Mage::log('method overrided...', null, 'override.log');

    } 
}

What can be issues?

  • The error you have referenced is regarding the parameter you have passed to addMessages method. – Knight017 Dec 31 '18 at 8:26
  • After removing the parameter, facing the same issue. But when I print It's throwing different error - Fatal error: Call to a member function getItems() on null in app/code/core/Mage/Core/Block/Messages.php on line 115 – Mr. Nanhe Dec 31 '18 at 11:09
  • that means the collection of message is null – Knight017 Dec 31 '18 at 17:08

Your Answer

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

Browse other questions tagged or ask your own question.