Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It is possible to save a node with a mandatory term reference field even if we let the field empty.
How to reproduce:
- Create a vocabulary with some terms
- Create a Content Type with a term reference field to this vocabulary
- Make the field mandatory and choose the Autocomplete Deluxe widget and set the number of values to unlimited
- Create a node of that content type
- Try to save with the term reference field empty => This will not work, which is as expected
- Now, save it with some terms selected
- Edit the node again
- Try again to save with the term reference field empty => This works and this is not as expected
If we try the same with another widget, it works as expected, namely: It should be impossible to save a node with an empty term reference field if that field is mandatory.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2242459-8.patch | 6.74 KB | LNakamura |
#8 | interdiff-2242459-5-8.txt | 6.13 KB | LNakamura |
#5 | autocomplete_deluxe-respecting-required-2242459-5.patch | 1.68 KB | super_romeo |
Comments
Comment #1
TheOptimizer CreditAttribution: TheOptimizer commentedComment #2
tracker2k CreditAttribution: tracker2k commentedComment #3
tracker2k CreditAttribution: tracker2k commentedComment #4
super_romeo CreditAttribution: super_romeo commentedpatch updated
Comment #5
super_romeo CreditAttribution: super_romeo commentedpatch updated
Comment #6
LNakamura CreditAttribution: LNakamura at Mediacurrent commentedThanks, @super_romeo - #5 works great for me, though it introduced a couple of minor coding standards issues. I went ahead and fixed those as well as some pre-existing ones and re-rolled your patch. Also including an interdiff.
Comment #7
LNakamura CreditAttribution: LNakamura at Mediacurrent commentedComment #8
LNakamura CreditAttribution: LNakamura at Mediacurrent commented(Re)re-rolled my patch to incorporate recently merged updates...
Comment #9
edwardchiapetThanks @super_romeo and @LNakamura! Just tested this is looks great!
Will merge this into dev.
Comment #11
edwardchiapet