Add support for Address field

Created on 7 July 2022, almost 3 years ago
Updated 26 June 2025, 2 days ago

Problem/Motivation

Partially filled compound fields are not validated by Require on Publish (ROP).

When partially filled, the subfields are not considered during ROP validation unless they pass their individual require validation.

Keep in mind that these contrib-module compound fields have their own required/optional setting for the subfields. Those can be set as either optional or required.

Example with Address

Address field takes it a step further by issuing the required="required" attribute, which kicks in the client-side form validation.

Steps to reproduce

  1. Install Address β†’ .
  2. On the Basic Page content type, create a field of type Address.
  3. Leave the default require settings (Overrides for Address).
  4. Ensure Require on Publish is selected on each field.
  5. Create a Basic Page node; fill out only one of the required subfields, leaving the others empty.
  6. Attempt to submit Draft. Fails require validation.
  7. Attempt to submit Published. Fails require validation.

Proposed resolution

When a field is marked Required on Publish, we must Ensure that the required="required" attribute is removed from subfields, and either...

  1. Provide module-specific field settings to mark subfields as required on publish.
  2. Consider any required subfields to be required on publish.

The latter is the simpler of the two, but still may require module-specific handling because modules have different methods of creating and marking subfields as required.

Remaining tasks

Add support for compound fields.

User interface changes

Add indicators (blue carat) to subfields.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

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.

  • πŸ‡ΊπŸ‡ΈUnited States jcandan

    Updated the issue summary based on understanding captured in ✨ Add support for multi-value fields like Name and Address fields Active .

    Original report

    Problem/Motivation

    Address field is actually detected by 'Require on publish' module ('Warning on Empty' message is well displayed) but no indicator is added to the field label.

    Might be useful for all other fields that output their widget #type as 'details'.

    Remaining tasks

    Add the missing 'form-required-on-publish' class to the <summary> tag.

Production build 0.71.5 2024