Non-Shooting Events / Non-Purple Observers

I have a module that listens for several events. It works great, at least in the dozen installations I tested on.

In the case of a specific installation, the client that I installed on Magento version 1.4.1.1, it does not work. When I tested his system and I fire events manually, for example, Mage :: dispatchEvent ('..'), the observer listens for them.

What should I do? I do not know what could be causing this.

+4
source share
2 answers

There are several reasons why this may occur.

  • The event you are trying to listen to does not exist in your version of Magento

  • Someone hacked into the main file and accidentally deleted the event you are listening to

  • Someone overrides the method

  • Your observer is not configured correctly and Magento does not see it.

  • Your observer is configured correctly, but the old configuration is cached

The steps that I will take for debugging are

  • Make sure that the combined global configuration has the configuration of your event. If it does not clear your caches, until it appears

  • Download the latest source code and split your app/code/core/ and lib/ into the virgin version. Type man diff from the unix prompt to learn about the diff tool if you are not already familiar with it.

  • Grep (or ack ) is the base code base for the event you are trying to listen to.

  • Temporarily add the registration code Mage::dispatchEvent to app/Mage.php to ensure that the event you are looking for is actually triggered.

  • Starting with Mage::dispatchEvent , follow the execution path to the point at which calls are being listened to and see why the code in Magento does not call your method.

The first time you do this, there will be time, and take notes on what happens in the main Magento system code. Thus, the next time you debug a similar problem, it will be much faster (if you really want to be beautiful, you can share what you find here, on your blog or on the Magento wiki)

+19
source

All Articles