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.
hello,
widget: select list
Maximum number of values users can enter for this field - set to 5 (values)
but on selecting 10 values...all the values are saved.
Comment | File | Size | Author |
---|---|---|---|
#4 | cck_check_multiple-324301-4.patch | 1.11 KB | yched |
Comments
Comment #1
yched CreditAttribution: yched commentedStange - I could've sworn we had some code to handle that, but cannot find any...
Comment #2
yched CreditAttribution: yched commentedWe could probably add that easily to optionwidgets.
I think we might want to hardcode this in content.module for any 'multiple' widget, thus not relying on widgets to check this themselves.
Comment #3
KarenS CreditAttribution: KarenS commentedI worry about controlling values set by widgets that have opted out of having the content module handle multiple values. In the case of optionwidgets it's OK because we know exactly what it's doing, but it could break things for other modules.
But actually the number of values is a field setting, not a widget setting, and it's set by the content module, so it makes sense for the content module to check it when validating field values, before accepting field input.
Comment #4
yched CreditAttribution: yched commentedBut actually the number of values is a field setting, not a widget setting, and it's set by the content module
OTOH, so is 'required', and we still leave it up to widgets.
Actually, doing this in a general way is more complex than I thought, and doing it for optionwidgets is easy, so I'd vote for the easy way.
Attached patch does that.
Only hiccup is with multiple select : the "- none -" option counts for one value.
Aside from running hook_is_empty() to filter out empty values, I'm not sure of the best way to fix this.
Comment #5
yched CreditAttribution: yched commentedOK, I figured out how to filter 'none' at minimal cost. Fixed now.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.