Skip to content

Commit

Permalink
Check for null value
Browse files Browse the repository at this point in the history
  • Loading branch information
hkillam committed Jun 6, 2016
1 parent 19cf761 commit 0b10cce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CRM/Contact/Form/Edit/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,15 @@ public static function setDefaultValues(&$defaults, &$form) {
$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);
Expand Down

0 comments on commit 0b10cce

Please sign in to comment.