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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3586310-prototype-sdc-null-safety.patch | 5.91 KB | grgcrlsn321 |
Issue fork prototype-3586310
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
Comment #2
grgcrlsn321 commentedComment #3
grgcrlsn321 commentedHere's a patch
Comment #4
grgcrlsn321 commentedComment #5
grgcrlsn321 commentedComment #6
grgcrlsn321 commentedCreated MR. Updating to needs review.
Comment #8
grgcrlsn321 commentedComment #10
jldust commentedThis has been merged in and will be included in the next tagged release.