There was an old issue dealing with such an problem: Certain combination of options will make the field validation fail.
The way to reproduce the bug is simple:
- create a new field
- set it as required
- set the URL as optional
- set the title as optional
- save
At this point the validation fails, telling that either a title or a URL should be entered. This error message is inappropriate on the field settings page, while a default value is not specified.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2230171-4.patch | 805 bytes | rpayanm |
Comments
Comment #1
b-prod commentedThe patch below fixes the issue.
Comment #2
chris matthews commentedThe 5 year old patch to link.module does not apply to the latest link 7.x-1.x-dev and if still applicable needs a reroll.
Comment #3
philsward commentedThink I just ran into this...
I need to remove empty fields, but since the title is required, there is no way to remove them. (Thanks to Drupal not having a remove button for fields...)
The logic is wonky in that a required form within the field, despite all being blank, results in the page not saving to remove the empty fields.
Update: The field was not required, however Title was.
I believe there needs to be logic that "if all forms within link field are blank, ignore requirements and purge field".
Comment #4
rpayanmComment #5
damienmckennaThank you, that condenses it down to the bare fix and applies correctly.
Let's add some test coverage to this too.