summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2010-06-09 04:10:09 (GMT)
committer Karen Stevenson2010-06-09 04:10:09 (GMT)
commit465dff3d56c8ba153539132c74ef89511d0d8da3 (patch)
tree50394fb81b8c5c6c1739187fb20d07d978d4629c
parentae1c32f1772dd0f113c5ec653701ce4fea2399e3 (diff)
#470470 by neilnz, use iLIKE for postgres selects.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--includes/views/handlers/content_plugin_display_simple.inc7
-rw-r--r--modules/nodereference/nodereference.module7
-rw-r--r--modules/userreference/userreference.module7
4 files changed, 16 insertions, 6 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index cf3b4cc..484ae41 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -34,6 +34,7 @@ Features:
- #670344 by dagmar: Make CCK compatible with both, views 2 and views 3.
Bugfixes:
+- #470470 by neilnz, use iLIKE for postgres selects.
- #769592 by vkareh, add default values to nodeapi.
- #714762 by Robbert, make diff module integration PHP5 compliant.
- Add db_rewrite_sql() check to nodereference formatters.
diff --git a/includes/views/handlers/content_plugin_display_simple.inc b/includes/views/handlers/content_plugin_display_simple.inc
index db1e4bf..3892367 100644
--- a/includes/views/handlers/content_plugin_display_simple.inc
+++ b/includes/views/handlers/content_plugin_display_simple.inc
@@ -24,6 +24,13 @@ class content_plugin_display_references extends content_plugin_display_simple {
$options = $this->get_option('content_options');
if ($options['string'] !== '') {
+ $like = $GLOBALS["db_type"] == 'pgsql' ? "ILIKE" : "LIKE";
+ $match_clauses = array(
+ 'contains' => "$like '%%%s%%'",
+ 'equals' => "= '%s'",
+ 'starts_with' => "$like '%s%%'",
+ );
+
$match_clauses = array(
'contains' => "LIKE '%%%s%%'",
'equals' => "= '%s'",
diff --git a/modules/nodereference/nodereference.module b/modules/nodereference/nodereference.module
index 049a06c..a5f9159 100644
--- a/modules/nodereference/nodereference.module
+++ b/modules/nodereference/nodereference.module
@@ -882,10 +882,11 @@ function _nodereference_potential_references_standard($field, $string = '', $mat
}
if ($string !== '') {
- $match_operators = array(
- 'contains' => "LIKE '%%%s%%'",
+ $like = $GLOBALS["db_type"] == 'pgsql' ? "ILIKE" : "LIKE";
+ $match_clauses = array(
+ 'contains' => "$like '%%%s%%'",
'equals' => "= '%s'",
- 'starts_with' => "LIKE '%s%%'",
+ 'starts_with' => "$like '%s%%'",
);
$where[] = 'n.title '. (isset($match_operators[$match]) ? $match_operators[$match] : $match_operators['contains']);
$args[] = $string;
diff --git a/modules/userreference/userreference.module b/modules/userreference/userreference.module
index 4fb1e82..0c53678 100644
--- a/modules/userreference/userreference.module
+++ b/modules/userreference/userreference.module
@@ -779,10 +779,11 @@ function _userreference_potential_references_standard($field, $string = '', $mat
$join = array();
if ($string !== '') {
- $match_operators = array(
- 'contains' => "LIKE '%%%s%%'",
+ $like = $GLOBALS["db_type"] == 'pgsql' ? "ILIKE" : "LIKE";
+ $match_clauses = array(
+ 'contains' => "$like '%%%s%%'",
'equals' => "= '%s'",
- 'starts_with' => "LIKE '%s%%'",
+ 'starts_with' => "$like '%s%%'",
);
$where[] = 'u.name '. (isset($match_operators[$match]) ? $match_operators[$match] : $match_operators['contains']);
$args[] = $string;