Extension talk:ImageHistoryClear

From Organic Design wiki
Revision as of 05:22, 24 October 2008 by Nad (talk | contribs)

Parser errors:

Notice: Undefined index: title in C:\www\wiki4\extensions\ImageHistoryClear\ImageHistoryClear.php on line 24

Notice: Undefined property: StubObject::$mBodytext in C:\www\wiki4\extensions\ImageHistoryClear\ImageHistoryClear.php on line 56

--Jack 17:33, 24 October 2008 (NZDT)

The first error is due to the index "title" not existing in the array which since you're now using strict raises a warning, you'll need to encase the entire thing into a condition based on whether the title index exists (you can use isset() or in_array() and after that whether a title object could be made. Strict enforces safe coding practice which can be a bit tedious and verbose, but it solid and predictable.
The second error is that you've tried to access $wgOut before it's properly initialised - you should be accessing it from the callback function registered with the OutputPageBeforeHTML hook.
--nad 18:22, 24 October 2008 (NZDT)