Add support for multi-value fields like Name and Address fields

Created on 12 June 2024, about 1 year ago

Problem/Motivation

Address and Name fields in its entirety are detected by Require-On-Publish (ROP) module but not the subfields. The subfields are not considered as actual fields and it doesn't add indicators to them. So, ROP validates the entire multi-value field and only throws an error if the entire field (all sub-fields) is empty.

However, if only a part of the name field or address is empty, e.g."state" or "city" or "address line 1" field is empty, ROP does not consider them and still allows you to publish, without validating them, and no required-on-publish validation error is shown on the field.

Please note that: these fields e.g. name or address have their own required/optional setting for the subfields. Those can be set as either optional or required. ROP doesn't consider this either.

Steps to reproduce

Install address, https://www.drupal.org/project/address or name field module: https://www.drupal.org/project/name
Create a field of address field.
Set the subfields components to 'Optional'. Setting to 'Required' will not allow the form to be submitted even in draft/unpublished.

Ensure ROP module is enabled on the address field, fill only one of the subfields, leave others empty, submit Published. ROP doesn't kick in and you don't get any required messages on the address field. Same with Name field.

Remaining tasks

Add support for multivalue fields.

User interface changes

Add indicators (blue carat) to subfields.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States jumoke

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024