Skip to content

Commit

Permalink
CRM-14720 - smart groups based on postal code numeric ranges cause fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Oct 12, 2015
1 parent f2a28c5 commit cce2300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3586,7 +3586,7 @@ public function postalCode(&$values) {

// 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 {
Expand Down

0 comments on commit cce2300

Please sign in to comment.