Closed (cannot reproduce)
Project:
Drupal core
Version:
11.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2017 at 10:20 UTC
Updated:
13 Dec 2023 at 13:34 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
joachim commentedEditing it later works as expected.
Comment #10
quietone commentedTested on 9.3.x, standard install and the problem still exists.
Comment #15
lauriiiComment #16
joaopauloc.dev commentedComment #17
joaopauloc.dev commentedComment #19
joaopauloc.dev commentedComment #20
joaopauloc.dev commentedComment #21
smustgrave commentedI applied the MR and followed the steps in the issue summary
Created a Number(Integer)
Added 10 to the minimum
Added 6 as the default
I can save still.
Comment #22
joaopauloc.dev commentedThanks for the review @smustgrave, issues are fixed.
Comment #23
smustgrave commentedConfirmed the issue I was seeing in #21 has been fixed.
Comment #24
lauriiiLooks like the new test failed after the rebase 😔
Comment #25
akhil babu\Drupal\Core\Field\Plugin\Field\FieldType\NumericItemBase::getConstraints calls Drupal\Core\Field\FieldItemBase::getSettings and Drupal\Core\Field\Plugin\Field\FieldWidget\NumberWidget::formElement calls Drupal\Core\Field\WidgetBase::getFieldSettings to check for min and max values while saving the number field. But both getSettings and getFieldSettings return NULL for min and max values when creating number field. This is why validation is not working.
Comment #26
akhil babuThis issue seems to be fixed in drupal 11(11.x-dev branch).
\Drupal\Core\Field\Plugin\Field\FieldType\NumericItemBase::getConstraints as Drupal\Core\Field\FieldItemBase::getSettings correctly returns min and max values when creating the field.
Comment #27
akhil babuReview if error is reproducible in 11.x-dev
Comment #28
akhil babuComment #29
akhil babuComment #30
smustgrave commentedFeedback from MR still needs to be addressed.
Comment #31
joaopauloc.dev commentedThis issue was fixed on the current 11-x.

Follow the test below.
Not sure if I'm updating correctly but we don't need to fix the one anymore.
Thanks.