Last modified: 2007-11-06 09:24:27 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 T13826, the corresponding Phabricator task for complete and up-to-date bug report information.
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