Fatal: Default value for props, on update

Created on 1 October 2025, 23 days ago
Updated 9 October 2025, 14 days ago

Problem/Motivation

Following 🐛 Fatal: Default value for component props Needs work

If the value of a required prop is removed from ContextualFormPanel, no control is done, the prop storage is updated and we have a fatal error (probably Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template The property xxx is required.)

In UI Patterns 2, we rely on Form API blocking ComponentForm submission to avoid this unfortunate situation.

Proposed resolution

Must be done in 2 steps:

  • Client side: Don't send the request to display_builder.api_update maybe by adding hx-validate https://htmx.org/attributes/hx-validate/ to onInstanceFormChange and onInstanceUpdateButtonClick HTMX events.
  • Server-side:: in ApiController::update(), don't update the instance (InstanceInterface->setSource()) if the form is not validating
🐛 Bug report
Status

Active

Version

1.0

Component

Main / Misc.

Created by

🇫🇷France pdureau Paris

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024