Last modified: 2007-04-24 07:37:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9178 - the || disjunction operator in semantic search breaks page
the || disjunction operator in semantic search breaks page
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Markus Krötzsch
http://ontoworld.org/wiki/Special:Ask...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-06 06:15 UTC by S Page
Modified: 2007-04-24 07:37 UTC (History)
0 users

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


Attachments

Description S Page 2007-03-06 06:15:25 UTC
Pages that use || in semantic searches return a blank page (0-length HTML, no
content).

This happened fairly recently on ontoworld.org.

It makes pages like http://ontoworld.org/wiki/Help:Category (an unofficial help
page) appear blank.

Yet the documentation
http://ontoworld.org/wiki/Help:Semantic_search#Wildcards_and_disjunctions says
that || is the right way to require a disjunction.

You can see it if you go to http://ontoworld.org/wiki/Special:Ask
and query for [[Born in::Dallas||Iceland]]

Remove one of the terms and it works.
Comment 1 S Page 2007-03-06 21:35:32 UTC
On my local wiki, I get
Catchable fatal error: Object of class Title could not be converted to string in
C:\xampplite\htdocs\mediawiki\extensions\SemanticMediaWiki\includes\SMW_InlineQueries.php
on line 831
    $check_titles = array_diff( $titles , array() ); // Copies the array

According to the doc at http://php.net/manual/en/function.array_diff,
array_diff() casts to string when comparing array entries, and this fails for
MediaWiki's Title objects.

I think this broke in revision 17529 when normalizeRedirects() switched from
working on article names to working on Title objects.

Maybe there's a better way to copy the $titles array with the desired behavior.
 (I think array_unique() is a better function to use here and elsewhere than
array_diff() but it too casts to a string.)

Or, create a $check_title_article_ids array just with the title->getArticleID()s
and iterate through that; but the code is complex.
I think the code is also broken at line 850
		if (!array_key_exists( $id , $titles)) {
where it assumes a title's articleID is the key for title objects in an array.

A workaround is to disable redirect normalization by setting
$smwgIQRedirectNormalization = false; in the file.
Comment 2 Markus Krötzsch 2007-04-24 07:37:32 UTC
I think I fixed this one for now (at least [[Born in::Dallas||Iceland]] works,
and I addressed the issue with title keys). Future versions will get a better
redirect handling.

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


Navigation
Links