Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/252477

Change subject: CRM-17422 remove prefixing of wildcard to search.
......................................................................

CRM-17422 remove prefixing of wildcard to search.

This is a regression in 4.6 compared to 4.2.

Bug: T99836
Change-Id: I582c6e2396a676380df8b858481016ce9f7e73fd
---
M CRM/Core/BAO/CustomValue.php
1 file changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm-core 
refs/changes/77/252477/1

diff --git a/CRM/Core/BAO/CustomValue.php b/CRM/Core/BAO/CustomValue.php
index bf23c74..953d417 100644
--- a/CRM/Core/BAO/CustomValue.php
+++ b/CRM/Core/BAO/CustomValue.php
@@ -189,14 +189,11 @@
           $formValues[$key] = array('IN' => $formValues[$key]);
         }
       }
-      elseif (($htmlType == 'TextArea' ||
+      elseif (stristr($formValues[$key], '%') && ($htmlType == 'TextArea' ||
           ($htmlType == 'Text' && $dataType == 'String')
-        ) &&
-        !((substr($formValues[$key], 0, 1) == '%') ||
-          (substr($formValues[$key], -1, 1) == '%')
         )
       ) {
-        $formValues[$key] = array('LIKE' => '%' . $formValues[$key] . '%');
+        $formValues[$key] = array('LIKE' => $formValues[$key]);
       }
     }
   }

-- 
To view, visit https://gerrit.wikimedia.org/r/252477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I582c6e2396a676380df8b858481016ce9f7e73fd
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm-core
Gerrit-Branch: master
Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to