Last modified: 2009-09-04 00:55:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22431, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20431 - PPCustomFrame_DOM not properly constructed
PPCustomFrame_DOM not properly constructed
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.16.x
All All
: Normal normal (vote)
: ---
Assigned To: Tim Starling
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-28 20:44 UTC by Juliano F. Ravasi
Modified: 2009-09-04 00:55 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch (3.22 KB, patch)
2009-08-28 20:44 UTC, Juliano F. Ravasi
Details

Description Juliano F. Ravasi 2009-08-28 20:44:30 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.
Comment 1 Brion Vibber 2009-09-03 01:19:34 UTC
Tim, can you take a peek at this? Thanks!
Comment 2 Tim Starling 2009-09-04 00:50:23 UTC
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.
Comment 3 Juliano F. Ravasi 2009-09-04 00:55:52 UTC
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!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links