Last modified: 2009-09-04 00:55:52 UTC
Created attachment 6501 [details] Patch PPCustomFrame_DOM (phase3/includes/parser/Preprocessor_DOM.php) derives from PPFrame_DOM, but it is not properly initialized. PPFrame_DOM::expand() uses $this->title, among other things, which is not set when a PPCustomFrame_DOM is created. Similar issue exists with PPCustomFrame_Hash. This makes custom frames almost unusable. The attached patch fixes this problem, by calling the parent constructors in order to correctly fill in the members of the base classes.
Tim, can you take a peek at this? Thanks!
Applied in r55795. The bug can be reproduced using eval.php: > $parser = new Parser( array( 'preprocessorClass' => 'Preprocessor_Hash' ) ); > $parser->startExternalParse($t = Title::newMainPage(), new ParserOptions, OT_HTML); > print $parser->replaceVariables("==t==\n{{{x}}}", array( 'x' => 'foo' ) ); Fatal error: Call to a member function getPrefixedDBkey() on a non-object in .../includes/parser/Preprocessor_Hash.php on line 983 Note that this feature was introduced in r36668 to service an extension, I don't think it's used in the core or any extension used on Wikimedia.
Thanks Tim! I use this feature in my extension [[Extension:Wikilog]] in order to expand a user-provided template with parameters filled from extension-generated data. If there is a risk of this feature being dropped or if there is a better way of achieving this, I would like to know! Anyway, thanks again!