Last modified: 2009-07-12 13:23:02 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 T20910, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18910 - Setting "{{#ask: ... |link=none}}" works, but "{{#ask: ... |link= none}}" does not.
Setting "{{#ask: ... |link=none}}" works, but "{{#ask: ... |link= none}}" doe...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-25 16:26 UTC by Dan Bolser
Modified: 2009-07-12 13:23 UTC (History)
0 users

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


Attachments

Description Dan Bolser 2009-05-25 16:26:32 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.
Comment 1 Markus Krötzsch 2009-07-06 07:49:20 UTC
Fixed in SVN.
Comment 2 Dan Bolser 2009-07-11 20:13:58 UTC
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.
Comment 3 Markus Krötzsch 2009-07-12 13:23:02 UTC
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>

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


Navigation
Links