Last modified: 2011-11-10 17:18:40 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 T17558, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15558 - Allow includable special pages to be parameterized using wiki syntax.
Allow includable special pages to be parameterized using wiki syntax.
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.14.x
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Church of emacs
: patch
: 2447 23150 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-11 05:35 UTC by Purodha Blissenbach
Modified: 2011-11-10 17:18 UTC (History)
6 users (show)

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


Attachments
Parser passes on an associative array which contains the parameters. (1.73 KB, patch)
2010-04-11 21:39 UTC, Church of emacs
Details
Small fix (1.54 KB, patch)
2010-04-15 20:57 UTC, Church of emacs
Details

Description Purodha Blissenbach 2008-09-11 05:35:25 UTC
Allow includable special pages to be parameterized using wiki syntax resembling named temlate parameters like this:
{{Special:Allpages|namespace=2|from=Alfonso Louise|to=Mattias Pasta}}

Parameter names should be identical to those already used on the command line.

All that the wiki syntax parser needs to do is, process the parameter string into a parameter block format that is identical to that which the special page expects anyways, and call the special page giving indication that a parameter block is acutally present.

Note, that this is already working: {{Special:PrefixIndex/User:Alfonso_Louis}} - so we can pass one parameter at times, when a special page allows this type of call, but not more than this.
Comment 1 Niklas Laxström 2008-09-19 08:11:23 UTC
Note: many special pages do their own parsing of the input and some of them allow multiple parameters. Would be nice to standardize the syntax. Not sure how to do it in bc way though.
Comment 2 Alexandre Emsenhuber [IAlex] 2010-04-11 10:14:56 UTC
*** Bug 23150 has been marked as a duplicate of this bug. ***
Comment 3 Happy-melon 2010-04-11 14:03:30 UTC
The issue is that most special pages take most of their parameters from the URL GET request using $wgRequest->getVal().  One parameter is extracted from the subpage of the page title, so that's easy to achieve in transclusion, but the problem with the other parameters is that you have not only to pass them through, but also to make the execute() method actually *use* them.
Comment 4 Church of emacs 2010-04-11 14:10:02 UTC
(Edit conflict :))
I'm assigning this bug to myself. Fixing it consists of two parts:
1. Making the parser pass on an array of already-parsed arguments
2. Make every single includable special page accept and use those parameters (beside $wgRequest)

Fixing 1. requires converting the DOM tree of arguments to an associative array - so basically all the arguments have to be parsed themselves before they can be passed on to the special page object (you have to do that, or something like {{Special:Foo|bar={{#someParserfunction: ... }}}} won't work). Converting the $args object to an array is where I'm currently stuck. $frame->expand( $args ) returns a string "param1=value1param2=value2..." (note the missing separator).
Comment 5 Church of emacs 2010-04-11 16:30:16 UTC
Okay, problem 1. is solved (just want to make sure no one else wastes hours on that :))
Comment 6 Church of emacs 2010-04-11 21:39:54 UTC
Created attachment 7284 [details]
Parser passes on an associative array which contains the parameters.

Okay, fixed it. Thanks to Happy-melon, he figured out how to turn the DOM tree into an associative array. The rest is also fairly simple and short, even though it's not the nicest thing to fake $wgRequest (but then again, the code is only as bad as the surrounding code).
I'll commit it after some more tests and in case no one complains here.
Comment 7 Church of emacs 2010-04-15 20:57:53 UTC
Created attachment 7298 [details]
Small fix

removed some debugging code.

Comment from some devs at !wmcon: Nasty way of doing this, but there doesn't seem to be an easy & nice sollution.
Comment 8 Alexandre Emsenhuber [IAlex] 2011-08-02 15:40:37 UTC
Fixed in r93758.
Comment 9 LordAndrew 2011-11-10 17:18:40 UTC
*** Bug 2447 has been marked as a duplicate of this bug. ***

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


Navigation
Links