Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1.3, 3.4.2
-
Component/s: CiviCRM Profile
-
Labels:None
Description
Rationale
========
Greeting and Addressee values need to be set for contacts if the user is using greetings in mailings or creating mailing labels. For many sites, large numbers of contacts are created via Profile input (in user registration, online contribution pages, event registration, standalone profiles etc.). These contacts should have greeting and addressee values set if possible.
There is also buggy behavior when a contact is updated via Profile. We are clearing the cached values (*_display) for email_greeting and addressee (but NOT for postal_greeting for some reason). We should be updating the cached value if relevant fields are present and otherwise leaving values unchanged.
Implementation
============
When creating a contact from a Profile form, check the default email_greeting, postal_greeting and addressee options for that contact type. Then set email_greeting_id, postal_greeting_id (individual and household) and addressee_id (all contact types), as well a *_display values.
NOTE: In the backend contact edit form, we set *_display values regardless of whether the referenced fields are present. EXAMPLE: email_greeting option is 'Prefix+First+Last Name'. If Prefix is not set, we still set email_greeting_display (to 'First+Last Name'). Let's discuss whether we should follow this behavior, or check for referenced fields before setting the *_display value.
When updating a contact from a Profile, we should update *_display values to match current values of referenced fields in the DB after the profile form updates are applied.