Last modified: 2011-09-19 18:48:19 UTC
Testing a query [1] on 1.18alpha together with SMW 1.6.2 r96240, SRF 1.6.1 r96240 forces an error as in [2]. [1] {{#ask:[[Keyword::...]]|?Title|format=category|limit=20|headers=hide|link=all |offset=0|mainlabel=-}} [2] Catchable fatal error: Argument 1 passed to SMWStore::getWikiPageSortKey() must be an instance of SMWDIWikiPage, instance of SMWDIString given, called in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\queryprinters\SMW_QP_Category.php on line 68 and defined in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\storage\SMW_Store.php on line 214
Just checked against the latest SVN trunk r97500, for the query above errors are: Warning: Division by zero in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\queryprinters\SMW_QP_Category.php on line 56 Warning: Division by zero in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\queryprinters\SMW_QP_Category.php on line 58 Catchable fatal error: Argument 1 passed to SMWStore::getWikiPageSortKey() must be an instance of SMWDIWikiPage, instance of SMWDITime given, called in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\queryprinters\SMW_QP_Category.php on line 68 and defined in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\storage\SMW_Store.php on line 214
Fixed by r97507
Sorry we aren't quite their yet ... testing results for r97507 still causes an error for query [1] (it doesn't matter if the query make sense or not, surely it doesn't but the error breaks Special:Ask) Catchable fatal error: Argument 1 passed to SMWStore::getWikiPageSortKey() must be an instance of SMWDIWikiPage, instance of SMWDITime given, called in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\queryprinters\SMW_QP_Category.php on line 75 and defined in D:\xampp\htdocs\lab\t1180\extensions\SemanticMediaWiki\includes\storage\SMW_Store.php on line 214 [1] {{#ask:[[Modification date::+]] |?Modification date |format=broadtable |limit=20 |headers=show |mainlabel=- |link=all |class=sortable wikitable |offset=0 }}
wrong format it should be >> format=category that causes trouble {{#ask:[[Modification date::+]] |?Modification date |format=category |limit=20 |headers=show |mainlabel=- |link=all |class=sortable wikitable |offset=0 }}
Looks like this format simply fails when you omit the subject... Fixed easily enough though.
Fixed by r97535. This gets rid of the error, but it's not an ideal fix. This format was apparently only designed to handle pages. If you don't include the subject (ie when having mainlabel=-), the headers will display the first char of the sort key, which doesn't make a lot of sense, and the sort itself seems to be wrong. Enhancing that would be a feature request though.