dev/core#3028 - For invalid greetings, return '' instead of failing
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 28 Jan 2022 05:58:07 +0000 (21:58 -0800)
committerTim Otten <totten@civicrm.org>
Fri, 28 Jan 2022 05:58:07 +0000 (21:58 -0800)
CRM/Contact/BAO/Contact.php

index 329ed5e421271ffb2d4c349f807bc60d2ba6bf70..5f63159d4f50e8c61e4d1e77f148bb5f6e45eec6 100644 (file)
@@ -3543,7 +3543,7 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id )
       'contact_type' => $contact->contact_type,
       'greeting_type' => $greetingType,
     ];
-    return CRM_Core_PseudoConstant::greeting($filter)[$contact->{$idField}];
+    return CRM_Core_PseudoConstant::greeting($filter)[$contact->{$idField}] ?? '';
   }
 
   /**