When I used the code given in the above link, It throws an error when cache is turned on. Noticed that this issue occurs when "Layouts" cache is enabled. This code is in the model class . I am using Magento 1.14 EE
Fatal error: Call to a member function setData() on boolean in ....
It works fine when:
- when cache is turned off.
- Runs perfectly when code in external script( in the root folder of magento) and cache is turned on.
Anyone faced this issue ?