Skip to content
GitLab
  • Explore
  • Sign in
  • DevelopmentDevelopment
  • CiviCRM CoreCiviCRM Core
  • Issues
  • #2912

Can't save extra custom fields when inline and required

Overview

If you have a custom field set that allows multiple records with a required field and uses the inline style, then one record can be created but a second fails with ' ... is a required field' for all required fields.

Reproduction steps

Setup: Create a custom field set:

  1. Click on Administer -> Customize Data and Screens > Custom Fields.
  2. Click Add Set of Custom Fields
  3. Set Name: 'Test fields', Used for: Contacts, Does this Custom Field Set allow multiple records?: ticked, Display Style: Inline
  4. Click Save
  5. Field Label: Test, Data Type: Alphanumeric, Field input type: single-line input, Required: ticked [NB seems to affect all types, key thing is this is Required]
  6. Click Save

Create first record:

  1. Choose a contact
  2. In 'Test fields' custom fields section, click Edit, enter a value for 'Test' field, click Save [Should succeed]

Try to create second record - need to use 'Edit Contact'

  1. On contact view, click Edit
  2. In 'Test fields' section, click Another Test fields record
  3. Enter value, click Save
  4. Get Please correct the following errors in the form fields below: Test is a required field.

Current behaviour

Second field produces error

Expected behaviour

Second field saves without error

Environment information

  • CiviCRM: 5.41.0, Master. This used to work seems to have changed somewhere between 5.36.1 and 5.41.0

Comments

  • The field saves correctly if not 'required'.
  • The field saves correctly if displayed as 'Tab' or 'Tab with Table'. Problem occurs only when both 'Required' and 'Inline'.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking