5

I have a strange issue which I think I narrowed down to observers occasionally not being triggered.

Situation:

An Observer for sales_order_invoice_save_before (in the global node), serializes some custom attributes. In most cases, this works fine, but in ~5% of the cases I get the string Array in sales_flat_order_invoice, as if the observer was not triggered.

I did not find out yet, what these orders/invoices have in common, but I want to be sure that I am on the right track and the issue isnt't somewhere else.

Question:

In which cases is it possible that models are saved without dispatching their {$eventPrefix}_save_before event? I can only imagine raw SQL queries but maybe I am missing something?

4
  • {$eventPrefix}_save_before is hardcoded in Mage_Core_Model_Abstract::_beforeSave. So, unless you override _beforeSave completely for a given model class, I don't think this is possible.
    – laketuna
    Jul 16, 2015 at 16:15
  • Can you find a common pattern for those 5% of the invoices?
    – Marius
    Jul 16, 2015 at 20:04
  • Can you post here the observer method and the config.xml definition? Does your module have the proper depends node in the module definition file from app/etc/modules?
    – Adi
    Aug 2, 2015 at 15:10
  • It looks like this error has another reason. I'll leave the question open in case somebody has a general answer, but I eventually solved my problem in a different way, case closed. Aug 20, 2015 at 7:08

2 Answers 2

0

What I suggest you is, override the event into any extension or include that file into local and then change the code according to your requirement.

0

It looks like this is actually not possible. The observed behavior might have been a side effect of another observer that was registered for the same event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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