Problem

When a multivalue prop already has content exceeding a limit that is subsequently set (or tightened), the component throws a hard rendering exception instead of handling the violation gracefully. This breaks page rendering entirely for any page containing that component instance.

Error

Drupal\Core\Render\Component\Exception occurred during rendering of component in Page Home (3), field components:
[canvas:price_card/features] There must be a maximum of 3 items in the array, 4 found.

Steps to Reproduce

- Create a code component with a multivalue prop (no limit or higher limit).
- Add content with 4 or more values to a page using that component.
- Remove component.
- Update the component definition to set a maximum of 3 values on that prop.
- Load any page containing the affected component instance.

Expected Behavior

The component should render gracefully by truncating excess values.

Actual Behavior

fatal rendering exception is thrown, preventing the component from rendering.

Issue fork canvas-3587024

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

isholgueras created an issue. See original summary.

isholgueras’s picture

Component: … to be triaged » Code
Assigned: isholgueras » Unassigned
Status: Active » Needs review

tim.plunkett made their first commit to this issue’s fork.

tedbow’s picture

Assigned: Unassigned » tedbow

will review

narendrar’s picture

Status: Needs review » Needs work

Issue is fixed for code components. Moving to Needs Work to address below 2 issues.

  • This same issue will also occur in case of SDC components. To reproduce, enable canvas_test_sdc module, place Multivalue Props Component on page and decrease maxItems of text_limited to 2. Should we fix that in scope of this issue?
  • Issue: For required props, if we decrease the limit, example values are shown on page instead of user added values.