Last modified: 2008-06-08 15:51:42 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 T16256, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14256 - Fix for pattern-matching for attribute properties
Fix for pattern-matching for attribute properties
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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);

with:

                                        if ($labelcol == 'value_xsd')
                                                $string = str_replace('_', '\_', $strcond->string);
                                        else
                                                $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.


Navigation
Links