Last modified: 2011-10-31 01:08:28 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 T32543, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30543 - format = count doenst work
format = count doenst work
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-24 12:05 UTC by Simon Bachenberg
Modified: 2011-10-31 01:08 UTC (History)
2 users (show)

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


Attachments

Description Simon Bachenberg 2011-08-24 12:05:00 UTC
{{#ask: [[Kategorie:Projekte]]|format = count}}

SMW: 1.6.1 = No Result

SMW: 1.6.0 = 1996

SMW: <1.6.0 = 47.3610

www(dot)gesis(dot)org/sofiswiki/Test
Comment 1 Jeroen De Dauw 2011-08-24 12:35:08 UTC
There is an error in your query, as indicated by the yellow question mark thing put after it. Fixed the error and the count should show up (count queries are working fine for me using SMW trunk). Going on the difference in results between 1.6 and earlier, I'd say you are using some deprecated or otherwise changed functionality causing the error in the query.
Comment 2 Jeroen De Dauw 2011-08-24 12:36:03 UTC
Do feel free to reopen the bug if my guess is wrong :)
Comment 3 Simon Bachenberg 2011-08-24 12:39:38 UTC
dbolser gave me the tip to try my query qith out "format=count"

The Yellow Thing just say "Too many Results" for {{#ask: [[Kategorie:Projekte]]}}

The Code of the Page:
Test count [Kategorie:Projekte]:{{#ask: [[Kategorie:Projekte]]|format = count}}

Test without count [Kategorie:Projekte]:{{#ask: [[Kategorie:Projekte]]}}

In English it would be:
Test count [Category:Projects]:{{#ask: [[Category:Projects]]|format = count}}

Test without count [Category:Projects]:{{#ask: [[Category:Projects]]}}
Comment 4 Jeroen De Dauw 2011-08-24 12:42:50 UTC
Huh. I've not seen that before :) I'll try to look into this soonish.
Comment 5 Jeroen De Dauw 2011-08-25 13:44:58 UTC
I did a bit of searching through the code, and it turns out this is a SPARQL error specific to SMW 4store support - no wonder I had not seen it before. 4store is retuning that you have either hit the query complexity limit or that a number of results have been dropped (ie going over the result count limit). I'm guessing you are running into the later one. The count format will not display when there are errors (which I implemented because the handling code would causes a fatal PHP error in SMW 1.6.0). I'm not sure how to best fix this, as it's not clear which values, or even which types the relevant variables have. 

Can you place this at line 321 of includes/SMW_QueryProcessor.php

var_dump($res);var_dump($query);exit;

(That's right before $result = smwfEncodeMessages( $query->getErrors() );)

And then refresh the page and give me the output? (And obviously remove the line again.)

I don't have the time to set up a 4store install and test myself at the moment.
Comment 6 Simon Bachenberg 2011-08-25 14:02:57 UTC
I put your code here: Line 310 - 319

if ( is_string( $res ) ) {
	if ( array_key_exists( 'intro', $params ) ) {
		$res = str_replace( '_', ' ', $params['intro'] ) . $res;
	}
	if ( array_key_exists( 'outro', $params ) ) {
		$res .= str_replace( '_', ' ', $params['outro'] );
	}
	var_dump($res);var_dump($query);exit;
	$result = $res . smwfEncodeMessages( $query->getErrors() );
}

But i dont get any output on my Querypage :-(

p.s. I can totally understand that you have no time for setting up a 4store :)
Comment 7 Jeroen De Dauw 2011-08-25 14:15:43 UTC
Oops - that line should be put in the else part, above

$result = smwfEncodeMessages( $query->getErrors() );

Are you saying that setting up 4store is a pain/takes a long time?
Comment 8 Simon Bachenberg 2011-08-25 14:28:06 UTC
Now i have it there:

else {
	// When no valid result was obtained, $res will be a SMWQueryResult.
	var_dump($res);var_dump($query);exit;
	$result = smwfEncodeMessages( $query->getErrors() );
}

But there is no output on the querypage at all. Any Localconf setting, i should change ?

Setting up 4Store took me 2 Days, because there is no stable Debian release and i had to Compile everything on my own (with bad Linux knowledge)
Comment 9 Jeroen De Dauw 2011-08-25 15:22:22 UTC
> But there is no output on the querypage at all.

As in blank page, or as in nothing changed after putting that code there. In case of the former you need to change some stuff in LocalSettings, in case of the later I'm totally puzzled as to what's going on.
Comment 10 Simon Bachenberg 2011-08-25 17:26:37 UTC
Now it Worked :-)

int(0) object(SMWQuery)#336 (12) { ["sort"]=> bool(false) ["sortkeys"]=> array(1) { [""]=> string(3) "ASC" } ["querymode"]=> int(2) ["m_limit:protected"]=> int(10000) ["m_offset:protected"]=> int(0) ["m_description:protected"]=> object(SMWConjunction)#348 (2) { ["m_descriptions:protected"]=> array(4) { [0]=> object(SMWClassDescription)#308 (2) { ["m_diWikiPages:protected"]=> array(1) { [0]=> object(SMWDIWikiPage)#327 (4) { ["m_dbkey:protected"]=> string(4) "Item" ["m_namespace:protected"]=> int(14) ["m_interwiki:protected"]=> string(0) "" ["m_subobjectname:protected"]=> string(0) "" } } ["m_printreqs:protected"]=> array(0) { } } [1]=> object(SMWSomeProperty)#347 (3) { ["m_description:protected"]=> object(SMWValueDescription)#301 (4) { ["m_dataItem:protected"]=> object(SMWDIWikiPage)#326 (4) { ["m_dbkey:protected"]=> string(2) "Ba" ["m_namespace:protected"]=> int(0) ["m_interwiki:protected"]=> string(0) "" ["m_subobjectname:protected"]=> string(0) "" } ["m_comparator:protected"]=> int(1) ["m_property:protected"]=> object(SMWDIProperty)#325 (3) { ["m_key:protected"]=> string(4) "User" ["m_inverse:protected"]=> bool(false) ["m_proptypeid:protected"]=> string(4) "_wpg" } ["m_printreqs:protected"]=> array(0) { } } ["m_property:protected"]=> object(SMWDIProperty)#325 (3) { ["m_key:protected"]=> string(4) "User" ["m_inverse:protected"]=> bool(false) ["m_proptypeid:protected"]=> string(4) "_wpg" } ["m_printreqs:protected"]=> array(0) { } } [2]=> object(SMWSomeProperty)#349 (3) { ["m_description:protected"]=> object(SMWValueDescription)#338 (4) { ["m_dataItem:protected"]=> object(SMWDIWikiPage)#337 (4) { ["m_dbkey:protected"]=> string(118) "Security_versus_rights:_the_Europeanization_of_policies_on_human_trafficking,_people_smuggling_and_irregular_migration" ["m_namespace:protected"]=> int(0) ["m_interwiki:protected"]=> string(0) "" ["m_subobjectname:protected"]=> string(0) "" } ["m_comparator:protected"]=> int(1) ["m_property:protected"]=> object(SMWDIProperty)#331 (3) { ["m_key:protected"]=> string(5) "Titel" ["m_inverse:protected"]=> bool(false) ["m_proptypeid:protected"]=> string(4) "_wpg" } ["m_printreqs:protected"]=> array(0) { } } ["m_property:protected"]=> object(SMWDIProperty)#331 (3) { ["m_key:protected"]=> string(5) "Titel" ["m_inverse:protected"]=> bool(false) ["m_proptypeid:protected"]=> string(4) "_wpg" } ["m_printreqs:protected"]=> array(0) { } } [3]=> object(SMWSomeProperty)#350 (3) { ["m_description:protected"]=> object(SMWValueDescription)#345 (4) { ["m_dataItem:protected"]=> object(SMWDIWikiPage)#344 (4) { ["m_dbkey:protected"]=> string(4) "True" ["m_namespace:protected"]=> int(0) ["m_interwiki:protected"]=> string(0) "" ["m_subobjectname:protected"]=> string(0) "" } ["m_comparator:protected"]=> int(4) ["m_property:protected"]=> object(SMWDIProperty)#316 (3) { ["m_key:protected"]=> string(6) "Delete" ["m_inverse:protected"]=> bool(false) ["m_proptypeid:protected"]=> string(4) "_wpg" } ["m_printreqs:protected"]=> array(0) { } } ["m_property:protected"]=> object(SMWDIProperty)#316 (3) { ["m_key:protected"]=> string(6) "Delete" ["m_inverse:protected"]=> bool(false) ["m_proptypeid:protected"]=> string(4) "_wpg" } ["m_printreqs:protected"]=> array(0) { } } } ["m_printreqs:protected"]=> array(1) { [0]=> object(SMWPrintRequest)#340 (7) { ["m_mode:protected"]=> int(2) ["m_label:protected"]=> string(0) "" ["m_data:protected"]=> NULL ["m_typeid:protected"]=> bool(false) ["m_outputformat:protected"]=> bool(false) ["m_hash:protected"]=> bool(false) ["m_params:protected"]=> array(0) { } } } } ["m_errors:protected"]=> array(0) { } ["m_querystring:protected"]=> string(177) "[[Kategorie:Item]][[User::ba ]][[Titel::Security versus rights: the Europeanization of policies on human trafficking, people smuggling and irregular migration]][[Delete::!True]]" ["m_inline:protected"]=> bool(true) ["m_concept:protected"]=> bool(false) ["m_extraprintouts:protected"]=> array(0) { } ["m_mainlabel:protected"]=> string(0) "" }
Comment 11 Jeroen De Dauw 2011-08-25 18:34:55 UTC
Can you do view source when getting that value and place it at http://dpaste.org/ ? Not very readable like this. Looks like the value would be 0, even if it was displayed as it should. So this seems to be a 4store specific count issue.
Comment 12 Simon Bachenberg 2011-08-25 18:37:17 UTC
http://dpaste.org/OoVs/

Not Better :)
Comment 13 Simon Bachenberg 2011-08-25 18:42:17 UTC
The Code is still in the Script, you could look at the page your own maybe it looks better than.

For Testing you can use Test|test01
Comment 14 Jeroen De Dauw 2011-08-25 19:52:12 UTC
Right ok. Formatted paste here: http://pastebin.com/9AwivRZ3
Comment 15 Jeroen De Dauw 2011-10-31 01:08:28 UTC
IIRC this has been fixed. Do reopen if I'm mistaken and it's still on trunk :)

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


Navigation
Links