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.

CommentFileSizeAuthor
#4 cck_check_multiple-324301-4.patch1.11 KByched
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Stange - I could've sworn we had some code to handle that, but cannot find any...

yched’s picture

We 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.

KarenS’s picture

I 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.

yched’s picture

Status: Active » Needs review
FileSize
1.11 KB

But 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.

yched’s picture

Status: Needs review » Fixed

OK, I figured out how to filter 'none' at minimal cost. Fixed now.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.