- Issue created by @Deepesh151086
- 🇮🇱Israel jsacksick
This isn't really a "major" issue as entering a huge price like this is probably affecting demo sites or people just trying random things... But still, this should be fixed and we shouldn't crash like this.
- 🇮🇳India Deepesh151086
Hi @jsacksick we are doing the validation in commerce/modules/price/src/Element/Number.php. I am getting null while dumping $element['#max']. I am not sure where from we are getting this value. If we may set this value according the 'decimal' datatype field
( decimal(19,6) ) in this file , we can run the validation on max digit in price. - Status changed to Needs review
4 months ago 10:48am 18 July 2024 - 🇮🇱Israel jsacksick
Core suffers from the same problem... Not sure what is the best way of fixing this...
You can reproduce the same issue with the number field type, specifying the same precision / scale.Got the following error:
Numeric value out of range: 1264 Out of range value for column 'field_test_decimal_value'
We could add a try catch block around the
$save_return = $this->entity->save();
in ProductVariationForm, but not convinced this is the right fix as we're supposed to just save the entity from there...The attached patch is setting the #max value, but I don't really like this fix.