Last modified: 2007-11-06 09:24:27 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 11826 - if a bad query returns nothing, you don't get warning tooltip with query errors
if a bad query returns nothing, you don't get warning tooltip with query errors
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
http://ontoworld.org/wiki/Bugs#Inline...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-31 10:13 UTC by S Page
Modified: 2007-11-06 09:24 UTC (History)
0 users

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


Attachments

Description S Page 2007-10-31 10:13:48 UTC
A bad query that returns something shows a warning tooltip with the error string, e.g.:
  <ask>[[Help: ]][[Help:Annotation]]</ask>

But if a bad query returns nothing, you don't get a warning tooltips of errors from the query}}.  E.g. we add a second page to the above query:
  <ask>[[Help: ]][[Help:Annotation]][[Property:Climate]]</ask>

and see nothing.

The bug is in SMW_QueryPrinter.php's SMWResultPrinter->getResultHTML() method.  There are several code paths that don't append $this->getErrorString($results).  The one I hit is if count is 0 and no further results, then the result printer just returns the default text (usually none); but I think there are others.  The patch below fixes this case but leaves others; maybe it would be better to replace the early returns with fall-through to a single append of the error string before returning.

Index: SMW_QueryPrinter.php
===================================================================
--- .	(revision 27065)
+++ .	(working copy)
@@ -47,7 +47,8 @@
 		$this->readParameters($params);
 		if ($results->getCount() == 0) {
 			if (!$results->hasFurtherResults()) {
-				return htmlspecialchars($this->mDefault);
+				$result = htmlspecialchars($this->mDefault);
+				$result .= $this->getErrorString($results); // just append error messages
 			} elseif ($this->mInline) {
 				$label = $this->mSearchlabel;
 				if ($label === NULL) { //apply defaults
Comment 1 Markus Krötzsch 2007-11-06 09:24:27 UTC
We now instert the error messages within getResultHTML for all cases.

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


Navigation
Links