r81738 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81737‎ | r81738 | r81739 >
Date:13:31, 8 February 2011
Author:brion
Status:reverted (Comments)
Tags:
Comment:
Tweak for r79018: fatal errors due to something calling parser clearState when mOptions wasn't defined
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -194,7 +194,9 @@
195195 $this->firstCallInit();
196196 }
197197 $this->mOutput = new ParserOutput;
198 - $this->mOptions->registerWatcher( array( $this->mOutput, 'recordOption' ) );
 198+ if( $this->mOptions ) {
 199+ $this->mOptions->registerWatcher( array( $this->mOutput, 'recordOption' ) );
 200+ }
199201 $this->mAutonumber = 0;
200202 $this->mLastSection = '';
201203 $this->mDTopen = false;

Follow-up revisions

RevisionCommit summaryAuthorDate
r81742Quick fix instead of r81738. This way of working is completely unsupported...platonides15:05, 8 February 2011
r81759Revert r81738. Extensions calling clearState() with no mOptions fixed.platonides16:32, 8 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79018Store the options used by the parsing in ParserOutput, per r70783 CR.platonides19:21, 26 December 2010

Comments

#Comment by Platonides (talk | contribs)   14:40, 8 February 2011

I think this is a bug in the caller rather than the function. Note that clearState() is marked as private and always called when mOptions is set (usually from startExternalParse).

I guess something is passing a null ParserOptions, which would warn with trunk hints.

Status & tagging log