Ensure contacts without a name are updated when primary email changes
authorColeman Watts <coleman@civicrm.org>
Mon, 24 May 2021 20:47:18 +0000 (16:47 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 25 May 2021 11:59:55 +0000 (07:59 -0400)
commitda5e820b6f01dff13ef229a217f8e145ae79b9df
tree76af1a13be3780dde9ae1044f790325ea03caa3b
parentfcf34143f560c33de8741eaf6459ef9d620fd7be
Ensure contacts without a name are updated when primary email changes

Contacts with no name use their primary email as display_name and sort_name.
This ensures that when their primary email is updated, display_name and sort_name
will be updated as well.
Adds tests for APIv3, APIv4 & Afform.
Fixes dev/core#2622
13 files changed:
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Contact/Utils.php
CRM/Contact/Form/Inline/Email.php
CRM/Core/BAO/Block.php
CRM/Core/BAO/Email.php
Civi/Api4/Service/Spec/Provider/EmailCreationSpecProvider.php
ext/afform/admin/Civi/AfformAdmin/AfformAdminMeta.php
ext/afform/admin/ang/afGuiEditor/afGuiEntity.component.js
ext/afform/core/Civi/Afform/Event/AfformSubmitEvent.php
ext/afform/core/Civi/Api4/Action/Afform/Submit.php
ext/afform/core/afform.php
ext/afform/mock/tests/phpunit/api/v4/AfformUsageTest.php
tests/phpunit/api/v3/ContactTest.php