Adding default value validation on NumberWidget
1 unresolved thread
1 unresolved thread
Compare changes
@@ -6,6 +6,7 @@
@@ -75,6 +76,11 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
@@ -114,4 +120,28 @@ public function errorElement(array $element, ConstraintViolationInterface $viola
I'm not sure we should be solving this with an additional element validate. This should be already handled by the constraints set by
\Drupal\Core\Field\Plugin\Field\FieldType\NumericItemBase::getConstraints
, so isn't there something wrong if the constraints aren't applied against the default value?