- Issue created by @andreasderijcke
- 🇧🇪Belgium andreasderijcke Antwerpen / Gent
- 🇧🇪Belgium andreasderijcke Antwerpen / Gent
Should have been fixed in 🐛 Cannot set both min and max values for numeric fields Active .
Perhaps it customisations that are interferring. Will double check later this week. - 🇺🇸United States apmsooner
This should already be fixed in previous release but dev branch also has some additional logic that should make it more sound as well. Can confirm if this is still an issue in dev at least.
- 🇺🇸United States apmsooner
I'm not able to reproduce this on latest release. Feel free to reopen with steps to reproduce if you're still seeing this issue.
- Status changed to Closed: cannot reproduce
17 days ago 6:53pm 15 July 2025 - 🇮🇪Ireland marksmith
Yeah, indeed. I was able to reproduce this on a fresh ddev install with only custom_field (and admin_toolbar) contrib module enabled. Tried with multiple versions of Drupal (10.5.1, 11.1.8, 11.2.2).
The solution I posted in my earlier reporting of this problem here 🐛 Cannot set both min and max values for numeric fields Active still appears to solve the error on my test site.
- 🇧🇪Belgium andreasderijcke Antwerpen / Gent
Found the culprit.
The code from marksmith ( https://www.drupal.org/project/custom_field/issues/3518147#comment-16060456 🐛 Cannot set both min and max values for numeric fields Active ) does not have the problem, but in the final refactored version, adding the constraint values is done if they have a value, not if the constraint is actually set. That causes the problem if you have only a min or max constraint set and not both.
MR coming up.
- Merge request !152Issue 3524259 Range constraint cannot have both min and max in combination... → (Merged) created by andreasderijcke
- 🇧🇪Belgium andreasderijcke Antwerpen / Gent
Third try is hopefully sound.
So, the problem occurred for non-float numerical fields that only have a min or max set on the field, but still have the DB restrictions applied.
In that case, changing the minMessage/maxMessage to notInRangeMessage should fix it. -
apmsooner →
committed 51c97a7f on 3.1.x authored by
andreasderijcke →
Issue #3524259 by andreasderijcke, apmsooner, marksmith: Numerical field...
-
apmsooner →
committed 51c97a7f on 3.1.x authored by
andreasderijcke →
-
apmsooner →
committed 51c97a7f on 4.0.x authored by
andreasderijcke →
Issue #3524259 by andreasderijcke, apmsooner, marksmith: Numerical field...
-
apmsooner →
committed 51c97a7f on 4.0.x authored by
andreasderijcke →