Issue #3587024: Handle decrease of cardinality

Closes #3587024

Update the component instance when reducing the cardinality.

Testing steps

  • 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.
  • Confirm that the "+ Add new" button is available.
  • Update the component definition to set a maximum of 3 values on that prop and "Add to components".
  • Load any page containing the affected component instance. Confirm the component fails gracefully (page renders, component does not).
  • Open the component tree for editing. Confirm the component instance was auto-updated: only 3 values remain, excess was truncated.
  • Confirm the "+ Add new" button is not available.
  • Save and reload the page. Confirm the component renders without error.
  • Edit again the component and convert it to unlimited.
  • Load the page and confirm that the "+ Add new" button is available again.
Edited by Ignacio Sánchez Holgueras

Merge request reports

Loading