0

Once in a while I get the following notice:

Notice: Undefined index:  title  in /opt/ocentric/magento/app/code/core/Mage/Reports/Model/Mysql4/Report/Collection.php on line 126

The ugly thing is that it's making the system.log file huge. Once it occurs the notice logging enters in a infinite loop. I can't figure out what triggers it.

Looking through the getIntervals() method it seems that this issue is related to date range filtering in the reports but I can't figure out how $t remains unset.

Any thoughts?

Thanks!

4

1 に答える 1

2

Magento 1.7 ではクラスが移動したので、どのくらい変わったのかわかりません。メソッド構造がほとんど変更されていないと仮定すると、$t['title']設定できない唯一の方法は、_period が「日」、「月」、または「年」でない場合です。個人的には、switch ステートメントの後に次のようなことを行うように、デバッグ コードをクラスに追加します。

if ( ! isset($t['title'])) {
    Mage::log('Period is '.$this->_period);
}

次回エラーが発生したときに、予期しない値が表示されることを願っています (何らかの理由で null であり、空の文字列につながる可能性があります)。そこから、デバッグするためのより良い情報が得られます。デバッグ バックトレースをログに記録することもできます。これは役立つ場合があります。

于 2012-10-05T14:57:06.850 に答える