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.
When attempting to save field settings for an integer 'Select (or other) list', if the default value is set to '- Select a value -' which it is by default, the configuration form will report the error:
Value must be a valid integer.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1494954-9-select_or_other-valid-integer.patch | 715 bytes | Hydra |
#7 | 1494954-select_or_other-valid-integer.patch | 658 bytes | mrfelton |
Screen shot 2012-03-24 at 9.56.12 AM.png | 18.09 KB | Rory |
Comments
Comment #1
Rory CreditAttribution: Rory commentedThe same form error appears if working with floats.
The default value of '- Select a value -' should be accepted.
As this is related to default values configured under field settings it might be related to #1494948: Default value isn't selected by default.
Comment #2
danielb CreditAttribution: danielb commentedconfirmed
Comment #3
danielb CreditAttribution: danielb commentedComment #5
ashrafabedI was still finding this error in the latest version, so I made this small edit:
select_or_other.field_widget.inc
Comment #6
haydeniv CreditAttribution: haydeniv commentedThis will get lost without an active status.
Comment #7
mrfelton CreditAttribution: mrfelton commentedPatch to that effect.
Comment #8
haydeniv CreditAttribution: haydeniv commentedThis does not apply to the latest dev anymore. Also this should also apply to number_float and number_decimal as well correct?
Comment #9
Hydra CreditAttribution: Hydra commentedComment #10
haydeniv CreditAttribution: haydeniv commentedCommitted: cd56ce8
Thanks.
Comment #13
troybthompson CreditAttribution: troybthompson commentedI'm still having this issue using 7.x-2.22 on a Decimal field and trying to set the default value as "unknown" and the patched code above seems to be there.
Also, when I test it on an integer field in this patch, I get the error:
Notice: Undefined index: value in number_field_validate() (line 137 of /usr/www/users/daedal/socialweb/modules/field/modules/number/number.module).
Notice: Undefined index: value in number_field_is_empty() (line 173 of /usr/www/users/daedal/socialweb/modules/field/modules/number/number.module).
Thoughts?
Comment #14
legolasboComment #16
cmseasy CreditAttribution: cmseasy commentedReopening.
Using version = "7.x-2.22",: I have the same error as the original issue:
The patched line from #9 is present in the code.
Comment #17
daften CreditAttribution: daften at Dropsolid commentedClosing as outdated because no activity in a long time and Drupal 7 goes EOL soon. Feel free to re-open if needed.