Steps to Reproduce

  • Create a code component
  • Add a prop of type : List
  • Mark it as Required
  • Mark Allow multiple value
  • Add to component
  • Drag and drop component to page
  • From a component setting - remove value for prop
  • Error :Drupal\Core\Render\Component\Exception\InvalidComponentException occurred during rendering of component in , field components: [canvas:] There must be a minimum of 1 items in the array, 0 found.

Issue fork canvas-3587869

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

neha_bawankar created an issue. See original summary.

utkarsh_33 made their first commit to this issue’s fork.

utkarsh_33’s picture

Issue summary: View changes
wim leers’s picture

Component: … to be triaged » Component sources
Issue tags: +Needs tests
Related issues: +#3516754: Finalize how we ascertain a `type: array` (aka multiple-cardinality) SDC/JS prop value is empty

This MR is changing JsComponent, so I expect test coverage additions in JsComponentTest

remove value for prop

Why is this even allowed for a prop that is required?

Error :Drupal\Core\Render\Component\Exception\InvalidComponentException occurred during rendering of component in , field components: [canvas:] There must be a minimum of 1 items in the array, 0 found.

This reminds me of #3516754: Finalize how we ascertain a `type: array` (aka multiple-cardinality) SDC/JS prop value is empty, because it introduced the minItems: 1 requirement.

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update
neha_bawankar’s picture

StatusFileSize
new4.65 KB

This is a regression. Previously, we could not remove the last value.
Only local images are allowed.

wim leers’s picture

Title: Removing value for a required prop of type List:text breaks component on page » Regression: Removing value for a required prop of type List:text breaks component on page
Component: Component sources » … to be triaged

Title updated per #7.

So then this is possibly a bug in the UI, or in the Redux-Integrated Field Widgets. Hard to tell.

Do we know which commit introduced the regression?