Last modified: 2008-06-08 15:51:42 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 14256 - Fix for pattern-matching for attribute properties
Fix for pattern-matching for attribute properties
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2008-05-25 05:38 UTC by Yaron Koren
Modified: 2008-06-08 15:51 UTC (History)
1 user (show)

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


Description Yaron Koren 2008-05-25 05:38:32 UTC
The function SMWSQLStore::getSQLConditions(), when it does pattern matching on values, always replaces spaces in the substring with underlines. This is fine for property names, and property values when the property is a relation, but not when the property is an attribute - there, spaces should be preserved. Thankfully, there's a simple fix - around line 1476 of /includes/storage/SMW_SQLStore.php, replace the line:

                                        $string = str_replace(array('_', ' '), array('\_', '\_'), $strcond->string);


                                        if ($labelcol == 'value_xsd')
                                                $string = str_replace('_', '\_', $strcond->string);
                                                $string = str_replace(array('_', ' '), array('\_', '\_'), $strcond->string);
Comment 1 Markus Krötzsch 2008-06-08 15:51:42 UTC
I have applied the above to the old SMWSQLStore implementation. The new store simply does never replace ' ' by '_', and leaves it to the caller to specify a proper search string. Patterns apply always to the DBkey forms of a Title object at this place, so it seems unnecessary to make extra effort here for fixing misshaped requests.

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