Last modified: 2011-12-26 23:12:25 UTC
(Semantic MediaWiki 1.5.6 running on MediaWiki 1.17.0) 1. Have this in LocalSettings.php: $smwgIgnoreQueryErrors = false 2. Create a page Test with these contents: {{#ask:[[Has incorrect type::]]|format=count}} (Any property works as long as the value is empty) This will result in a catchable fatal error: Object of class SMWQueryResult could not be converted to string in /var/www/p13.itawiki.org/w/extensions/SemanticMediaWiki-1.5.6/includes/SMW_QueryProcessor.php on line 319 The problem is that the code in SMWQueryProcessor::getResultFromQuery assumes that the output of $store->getQueryResult( $query ) (line 293) is a string when $query->querymode == SMWQuery::MODE_COUNT, and at line 319: return $res . smwfEncodeMessages( $query->getErrors() ); $res is an integer here, so this obviously fails. Obviously, it is a syntax error having an empty property value like that, but it's going to happen in templates when people put {{{whatever|}}} as the value.
$res is not an integer but an object of course, but the result is the same.
I tried to reproduce this and was not able to. Also had a look at the code and did not see anything wrong there. So I'm guessing it has been fixed in SMW 1.6. You can try upgrading to get rid of the issue. Thanks for reporting though :)
Tomas, have you had anymore trouble with this? I saw the same error occur on my own wiki, but I haven't been able to set up a demo for it yet. Do you have more information that might help me reproduce this bug in a demo?