Page MenuHomePhabricator

[SMW] 1.6.2 r96240; Catchable fatal error ... SMWStore::getWikiPageSortKey(), SMW_QP_Category.php
Closed, ResolvedPublic

Description

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=0mainlabel=-}}

[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


Version: unspecified
Severity: normal

Details

Reference
bz30761

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:58 PM
bzimport set Reference to bz30761.
Unknown Object (User) added a comment.Sep 19 2011, 3:14 PM

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

Unknown Object (User) added a comment.Sep 19 2011, 5:00 PM

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

}}

Unknown Object (User) added a comment.Sep 19 2011, 5:05 PM

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.