Last modified: 2011-11-10 17:18:40 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.
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.
*** Bug 23150 has been marked as a duplicate of this bug. ***
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.
(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).
Okay, problem 1. is solved (just want to make sure no one else wastes hours on that :))
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.
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.
Fixed in r93758.
*** Bug 2447 has been marked as a duplicate of this bug. ***