Page MenuHomePhabricator

Semantic Compound Query with format=count throws exception
Closed, InvalidPublic

Description

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


Version: master
Severity: minor

Details

Reference
bz48942

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:40 AM
bzimport set Reference to bz48942.
bzimport added a subscriber: Unknown Object (MLST).

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.

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?

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".

Aklapper subscribed.

This extension has moved. If this is still an issue, then please open a ticket at https://github.com/SemanticMediaWiki/SemanticCompoundQueries/issues - thanks!