Deprecation of Add Individual / Add Organisation forms

Created on 30 August 2022, about 2 years ago
Updated 1 February 2024, 10 months ago

Deprecation Announcement

Adding a new individual or a new organisation is currently done using modal dialogs. This approach was problematic for several reasons:

  • Cannot change which fields are shown without custom code.
  • Validation error messages are never displayed leading to confusion.
  • When a validation error occurs the dialog drops back into a page (non-modal), leading to confusion
  • The dialog is too small

The new version of Add Contacts will remove the use of the modal and instead use dedicated pages for adding individuals and organisations. This will be:

  • Fully customizable using form modes
  • Validation messages are shown
  • Consistent user experience

Technical Details

This is implemented using new form modes for the User entity (add_contact_individual and add_contact_organisation). These form modes then embed their respective profiles. Profile files are then configured with new form modes on the crm_org and crm_indiv profiles (add_contact).

Old behaviour and new are swapped out via a configuration setting (contacts.configuration.add_contact_form_type) which can either be legacy or current. If no value is set, it defaults to legacy for backwards compatibility. A fresh install of contacts will set this to current.

When set to legacy, the menu entries are altered to apply the relevant ajax attributes and the controller renders the old forms.

The old forms have been marked as @deprecated but not removed as various places make use of these for custom Add Contact implementations.

Upgrading

Existing installs of contacts will continue to use the old modal dialogs. To upgrade an existing client the following config will need to be installed:

  • contacts.configuration.add_contact_form_type will need to be set to current. This can be done via the Contacts Configuration UI
  • Install config/optional/core.entity_form_mode.profile.add_contact.yml
  • Install config/optional/core.entity_form_display.profile.crm_indiv.add_contact.yml
  • Install config/optional/core.entity_form_display.profile.crm_org.add_contact.yml

New installs of contacts will default to the new experience.

📌 Task
Status

Active

Version

2.0

Component

User interface

Created by

🇬🇧United Kingdom JeremySkinner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024