Required Boolean field in Not required field collection_field problem

Created on 5 July 2016, almost 8 years ago
Updated 30 August 2023, 10 months ago

Let say I have a field collection (I know this is not core, but the problem is coming the a core behavior) with 2 fields:

field_coll: NOT REQUIRED
- field_A: Text, required
- field_B: Boolean, required

I focus only on the Boolean field_B: It is required mostly because I don't want to have the n/a option.
Unfortunately, I can't save my content if I didn't fill in the field_collection.

To allow me to save my content (with an empty field_coll), I need to set field_B as not required... But in this case, the ugly n/a is showing up.

To summarize:

field_A is required and does not pose a problem if empty (and field_collection empty)
field_B is required and does pose a problem if empty (and field_collection empty)
This is not consistent

This is my stone for this old n/a problem

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium DuneBL

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 Kingdom catch

    This is a problem with the field collection widget - by rendering the form element, it's showing the required checkbox in the form. It would need to render no element at all, with an 'add' button.

Production build 0.69.0 2024