Problem/Motivation

Drupal 11's ComponentValidator rejects null for bare types (type: string, type: array). Prototype component schemas use bare types for optional props, so leaving any optional field empty causes InvalidComponentException: NULL value found, but a string is required and breaks page rendering.

The default Splide config in slideshow.twig uses the bare word loop as a value 'type': loop. Outside a {% for %} block, loop is undefined in Twig and evaluates to null, producing data-splide='{"type":null}'. Splide fails to initialize and the carousel does not function.

Steps to reproduce

1. Create a paragraph of type CTA, Pullquote, Slideshow, Teaser, or Video.
2. Leave at least one optional field (title, caption, link, etc.) blank.
3. View the node — the page throws an `InvalidComponentException`.

Create a slideshow
1. Add a Slideshow paragraph with at least one slide.
2. Do not pass an explicit options.type from the bridge template.
3. Inspect the rendered HTML — data-splide contains "type":null and the carousel is broken.

Proposed resolution

  • converts bare types to type: ['string', 'null'] and removes required arrays from optional props.
  • change 'type': loop to 'type': 'loop' for slideshow

Issue fork prototype-3586310

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

grgcrlsn321 created an issue. See original summary.

grgcrlsn321’s picture

Issue summary: View changes
grgcrlsn321’s picture

StatusFileSize
new5.91 KB

Here's a patch

grgcrlsn321’s picture

Status: Needs review » Active
grgcrlsn321’s picture

StatusFileSize
new5.91 KB
grgcrlsn321’s picture

Version: 5.5.0 » 5.x-dev
Status: Active » Needs review

Created MR. Updating to needs review.

grgcrlsn321’s picture

Issue summary: View changes

  • jldust committed aae51a93 on 5.x
    Issue #3586310: add null for validation for string and array props
    
jldust’s picture

Status: Needs review » Fixed

This has been merged in and will be included in the next tagged release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.