From 0b10cce0f349e3cf03c8a704e17aa41dfc1ceb6f Mon Sep 17 00:00:00 2001 From: Heather Killam Date: Sun, 5 Jun 2016 19:17:37 -0600 Subject: [PATCH] Check for null value --- CRM/Contact/Form/Edit/Address.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index aacbf14de0..effbc4224e 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -361,9 +361,15 @@ class CRM_Contact_Form_Edit_Address { $address['street_address'] = $streetAddress; } if (isset($address['street_number'])) { - $address['street_number'] .= CRM_Utils_Array::value('street_number_suffix', $address); + // CRM-17619 - if the street number suffix begins with a number, add a space + $thesuffix = CRM_Utils_Array::value('street_number_suffix', $address); + if ($thesuffix) { + if (ctype_digit(substr($thesuffix, 0, 1))) { + $address['street_number'] .= " "; + } + } + $address['street_number'] .= $thesuffix; } - // build array for set default. foreach ($parseFields as $field) { $addressValues["{$field}_{$cnt}"] = CRM_Utils_Array::value($field, $address); -- 2.25.1