Number prop: validate in normalize

Created on 7 April 2025, 15 days ago

Problem/Motivation

On a project having a prop integer with a minimum of 0, in Layout Builder, I got the following error:

Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("[duration] Must have a minimum value of 0"). in Twig\Template->yield() (line 1 of ..../components/.../....twig).

Because of sample values generated by generateSampleValue. So I also changed the minimum in the field definition of my block type, but having a check in the normalize of the prop type would avoid such fatal error.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024