Fatal error when merging Housholds (getTemplateForGreeting)
Overview
When I try to merge two households of which one has the "communication style" filled, the merge results in a fatal error
Reproduction steps
- Click on merge housholds
- Merge two households of which one has a "communication style" field
- Try to merge: end up with fatal error.
Current behaviour
TypeError: Return value of CRM_Contact_BAO_Contact::getTemplateForGreeting() must be of the type string, null returned in CRM_Contact_BAO_Contact::getTemplateForGreeting() (line 3509 of /var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
Notice: Undefined offset: 1 in CRM_Contact_BAO_Contact::getTemplateForGreeting() (line 3509 of /var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php).
Expected behaviour
Successful merge of two households
Environment information
- CiviCRM: 5.45.0
- CMS: Drupal 7.84
- PHP: 7.4.27 (fpm-fcgi)
- Database: 10.6.5-MariaDB-1:10.6.5+maria~bullseye-log engine: InnoDB 10 row format: Dynamic
- Webserver: Apache
- OS: Linux
Comments
Anything else you would like the reviewer to note.