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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Erik Frèrejean created an issue. See original summary.

Erik Frèrejean’s picture

Status: Active » Needs review
FileSize
720 bytes

I've attached a patch that corrects the validation and correctly allows 0 as min/max values on the field.