Problem/Motivation
The move of sub-field display settings to "Manage display" already helps a lot, but it is still not immediately clear that:
Check empty?
Remove row when this value is empty.
refers to the stored data for an entire custom field item, rather than hiding on presentation.
Steps to reproduce
- Have optional fields (which given the instruction that the outer custom field must be required for any subfield to be required, means much of the time all fields in a custom field are optional)
- Site builder makes a decision that it does not make sense for a custom field with partial values to be displayed. Mistakenly thinks that "Check empty / remove row" will suppress only the display. Edits a piece of test content and saves, looks great the custom field with the missing value does not show at all (but the site builder does not go back to the edit form to see the entered values have been removed entirely).
- Content editors merrily go along editing content, perhaps not even touching the custom field.
- Possibly massive unintentional content loss.
Proposed resolution
Bury this option under an "advanced" fieldset.
Change its label to "Discard other values if this one is empty".
And probably the 80% use case for this feature would be met by "sub-required" fields, that is, rather than silently throwing data out if a key field is empty, throwing a validation error informing the content author that the custom field does not make sense without it; then the field can either be filled in or the other values / row consciously deleted.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screenshot 2026-03-05 at 7.10.17 AM.png | 33.52 KB | apmsooner |
Issue fork custom_field-3551483
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
apmsooner commentedComment #3
apmsooner commented@mlncn,
I've updated the label and description to more explicitly explain the intent of the checkbox and additionally added a message (visible when box is checked) to further warn user. I feel like this is simple enough to get the point across. Agree?
Comment #5
apmsooner commentedComment #6
apmsooner commentedComment #8
apmsooner commented