Last modified: 2009-07-12 13:23:02 UTC
Setting "{{#ask: ... |link=none}}" works, but "{{#ask: ... |link= none}}" does not. I want to remove links to properties returned by an ask query, which appear for properties of type page. The answer is to set "|link=none" in the ask query. However, unlike most parameters of the ask query, the value of this parameter is sensitive to leading white space. i.e. setting "|link= none" is silently ignored. As the behaviour of "link=none" is not easy to understand for a newbie, this can be confusing. Especially when one searches for interactions with other parameters. (Basically I just spent 20 minutes 'debugging' this problem). Could you get the ask query to throw an error when incorrect parameters are used? DPL does this, and its very useful, as it will list the correct options for a parameter if you use an incorrect one. Also, please let me know where in the code a potential fix for this white-space problem could be found.
Fixed in SVN.
Can you show me the patch? I'd be interested in how this was fixed. Should I log the other stuff as separate feature requests? (I'm assuming that you have only fixed the white space issue.) Cheers, Dan.
Yes, please file another request for general "parameter not understood" error reporting. The patch was trivial (let's see if pre-tags work here): <pre> =================================================================== --- SMW_QueryPrinter.php (Revision 52785) +++ SMW_QueryPrinter.php (Revision 52786) @@ -213,7 +213,7 @@ $this->mSearchlabel = $params['searchlabel']; } if (array_key_exists('link', $params)) { - switch (strtolower($params['link'])) { + switch (strtolower(trim($params['link']))) { case 'head': case 'subject': $this->mLinkFirst = true; $this->mLinkOthers = false; </pre>