projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b1e446
)
CRM-14720 - smart groups based on postal code numeric ranges cause fatal
author
Eileen
<eileen@fuzion.co.nz>
Wed, 21 May 2014 09:07:52 +0000
(
05:07
-0400)
committer
eileenmcnaughton
<eileen@fuzion.co.nz>
Mon, 12 Oct 2015 07:18:07 +0000
(07:18 +0000)
CRM/Contact/BAO/Query.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Contact/BAO/Query.php
b/CRM/Contact/BAO/Query.php
index 04778d5076759b612a2bbc7e3b8393a8511732c2..f21943efa8cfb9073915f7db4579d6d7897a26f4 100644
(file)
--- a/
CRM/Contact/BAO/Query.php
+++ b/
CRM/Contact/BAO/Query.php
@@
-3515,7
+3515,7
@@
WHERE $smartGroupClause
// Handle numeric postal code range searches properly by casting the column as numeric
if (is_numeric($value)) {
- $field =
'ROUND(civicrm_address.postal_code)'
;
+ $field =
"IF (civicrm_address.postal_code REGEXP '^[0-9]+$', CAST(civicrm_address.postal_code AS UNSIGNED), 0)"
;
$val = CRM_Utils_Type::escape($value, 'Integer');
}
else {