From: Heather Killam Date: Mon, 6 Jun 2016 01:17:37 +0000 (-0600) Subject: Check for null value X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0b10cce0f349e3cf03c8a704e17aa41dfc1ceb6f;p=civicrm-core.git Check for null value --- 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);