Last modified: 2008-06-08 15:51:42 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);
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.