Hi,
forget about my last attached patch - here is another one. It includes an
additional (one-byte) fix that makes autocompletion on words after spaces (and
not only on the beginning of the property/page name) possible again.
Patrick.
--
Key ID: 0x86E346D4 http://patrick-nagel.net/key.asc
Fingerprint: 7745 E1BE FA8B FBAD 76AB 2BFC C981 E686 86E3 46D4
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Semantic Forms" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/semantic-forms?hl=en
-~----------~----~----~----~------~----~------~--~---
diff -Nur SemanticForms.original/includes/SF_AutocompleteAPI.php SemanticForms/includes/SF_AutocompleteAPI.php
--- SemanticForms.original/includes/SF_AutocompleteAPI.php 2009-03-30 20:06:17.000000000 +0800
+++ SemanticForms/includes/SF_AutocompleteAPI.php 2009-04-22 15:17:27.000000000 +0800
@@ -137,7 +137,7 @@
$substring = str_replace(' ', '_', strtolower($substring));
$substring = str_replace('_', '\_', $substring);
$substring = str_replace("'", "\'", $substring);
- $conditions .= " AND (LOWER($value_field) LIKE '" . $substring . "%' OR LOWER($value_field) LIKE '%\_" . $substring . "%')";
+ $conditions .= " AND (LOWER(CONVERT($value_field USING utf8)) LIKE '" . $substring . "%' OR LOWER(CONVERT($value_field USING utf8)) LIKE '%_" . $substring . "%')";
}
$sql_options['ORDER BY'] = $value_field;
$res = $db->select( $from_clause,
diff -Nur SemanticForms.original/includes/SF_Utils.inc SemanticForms/includes/SF_Utils.inc
--- SemanticForms.original/includes/SF_Utils.inc 2009-04-04 09:35:13.000000000 +0800
+++ SemanticForms/includes/SF_Utils.inc 2009-04-22 15:12:57.000000000 +0800
@@ -244,7 +244,7 @@
$substring = str_replace(' ', '_', strtolower($substring));
$substring = str_replace('_', '\_', $substring);
$substring = str_replace("'", "\'", $substring);
- $conditions = 'cl_to = '. $db->addQuotes($category) . " AND (LOWER(page_title) LIKE '" . $substring . "%' OR LOWER(page_title) LIKE '%\_" . $substring . "%' OR page_namespace = " . NS_CATEGORY . ")";
+ $conditions = 'cl_to = '. $db->addQuotes($category) . " AND (LOWER(CONVERT(`page_title` USING utf8)) LIKE '" . $substring . "%' OR LOWER(CONVERT(`page_title` USING utf8)) LIKE '%\_" . $substring . "%' OR page_namespace = " . NS_CATEGORY . ")";
} else {
$conditions = 'cl_to = '. $db->addQuotes($category);
}
@@ -334,7 +334,7 @@
$substring = str_replace(' ', '_', strtolower($substring));
$substring = str_replace('_', '\_', $substring);
$substring = str_replace("'", "\'", $substring);
- $conditions .= " AND (LOWER(page_title) LIKE '$substring%' OR LOWER(page_title) LIKE '%\_$substring%')";
+ $conditions .= " AND (LOWER(CONVERT(`page_title` USING utf8)) LIKE '$substring%' OR LOWER(CONVERT(`page_title` USING utf8)) LIKE '%\_$substring%')";
}
$sql_options['ORDER BY'] = 'page_title';
$res = $db->select( $db->tableNames('page'),