Last modified: 2011-03-13 18:04:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12842 - DOM-Like Preprocessor Automatically Expands First Argument
DOM-Like Preprocessor Automatically Expands First Argument
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.12.x
PC Windows XP
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-30 21:29 UTC by David
Modified: 2011-03-13 18:04 UTC (History)
2 users (show)

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


Attachments

Description David 2008-01-30 21:29:25 UTC
When I create parser functions that accept DOM-style arguments, the first argument is already expanded.  Example:  If I do a var_dump() of args[0] in the [[meta:Help:ParserFunctions]]' ExtParserFunctions::ifObj() method, it shows that the argument is a string.  The other arguments are fine though.  They show up as PPNode_DOM objects.
Comment 1 Tim Starling 2008-02-02 11:30:26 UTC
Right, that's how it is, and that's how it will stay.
Comment 2 David 2008-02-02 18:14:40 UTC
Ah, so it's that way by design.  Okay.  The work-around is easy enough, I'll just make my parser function not use the first argument.
Comment 3 Tim Starling 2008-02-03 00:52:04 UTC
You should call trim($frame->expand($arg)) on each argument regardless of whether it is a string or a PPNode. You should not be accessing the underlying tree. 
Comment 4 David 2008-02-03 19:59:35 UTC
I'm using both PPFrame::expand() and PPNode_DOM::splitArg() for the "param=value" pairs.  The issue is that I don't want the first arg to be expanded automatically—in some cases not at all—depending on the other "param=value" arguments.

There's also an issue with timing; when the argument gets expanded.  For instance, with [[mw:Extension:Cite/Cite.php]] the following:

 <ref>E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.</ref>
 
 <references/>

Gives a very different result than:

 <references/>
 
 <ref>E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.</ref>

If my extension is going to interact with other extensions where timing is important, I want to make sure the argument gets expanded when its supposed to, and not prematurely.

But as I said, this is minor since I have a workaround.  In fact, since the current behavior is intended, this isn't a bug, but an enhancement request.

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


Navigation
Links