Last modified: 2013-05-29 16:39:32 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 T50942, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48942 - Semantic Compound Query with format=count throws exception
Semantic Compound Query with format=count throws exception
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticCompoundQueries (Other open bugs)
master
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-29 15:14 UTC by Jamie Thingelstad
Modified: 2013-05-29 16:39 UTC (History)
2 users (show)

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


Attachments

Description Jamie Thingelstad 2013-05-29 15:14:25 UTC
I sort of figured this would cause issues and indeed it throws a PHP exception:

{{#compound_query:
   [[Category:Website]] [[Has active users count::+]] [[Has farm::Farm:Wikimedia]] ; ?Has active users count=Active Users ; limit=500
 | [[Category:Website]] [[Has active users count::+]] [[Has farm.Has farm::Farm:Wikimedia]] ; ?Has active users count=Active Users ; limit=500
 | format=count
}}

The exception is:

PHP message: PHP Fatal error:  Call to a member function getResults() on a non-object in .../extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php on line 221
Comment 1 Yaron Koren 2013-05-29 15:44:13 UTC
Perhaps what you're looking for is "format=sum", not "format=count"? I'm guessing that based on the fact that you have a "?Has active users count" printout in there - if you were just counting the number of rows, printouts wouldn't make sense.
Comment 2 Jamie Thingelstad 2013-05-29 16:23:56 UTC
Sorry, I should have clarified. The query is indeed bogus. I was debugging trying to make something work and did the count just to try and see what I was getting back. I submitted the bug only because it throws a PHP exception that isn't handled and causes no response from the server. I'm guessing that is because count seems to not really be a format, since it also has problems in the Ask API and required special handling. Perhaps it should be an illegal option to compound queries?
Comment 3 Yaron Koren 2013-05-29 16:39:32 UTC
Alright. Yes, "format=count" does work very differently from all the others. It's true that PHP errors are never a good thing - still, I'm marking this as "minor".

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


Navigation
Links