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.
I'm using the "Number field" widget, but noticed that you can't use "0" as min or max value. Looking into the code I've noticed that there are some checks (inconsistent between the two as well) that do not correctly validate the contents of $instance['settings']['min']
.
if (!empty($instance['settings']['min']) || $instance['settings']['min'] === '0') {
However $instance['settings']['min']
turns out to be an integer when I var_dump the value.
Comment | File | Size | Author |
---|---|---|---|
#2 | number_field_widget-2715003-2.patch | 720 bytes | Erik Frèrejean |
Comments
Comment #2
Erik FrèrejeanI've attached a patch that corrects the validation and correctly allows 0 as min/max values on the field.