Problem/Motivation

The Component Validator throws InvalidComponentException when slots contain content examples, preventing components from loading properl
Error:
Drupal\Core\Render\Component\Exception\InvalidComponentException: [slots.media.examples[0]] Object value found, but a string is required in Drupal\Core\Theme\Component\ComponentValidator->validateDefinition() (line 144 of core/lib/Drupal/Core/Theme/Component/ComponentValidator.php).

Proposed resolution

Remove examples from slot definitions in component YAML files. Slots should only contain title and description properties.

Issue fork artisan-3535765

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

iván barrios created an issue. See original summary.

ivanbarr’s picture

anirudhsingh19’s picture

Assigned: Unassigned » anirudhsingh19

working on it.

anirudhsingh19’s picture

Assigned: anirudhsingh19 » Unassigned
Status: Active » Needs review

Created MR for this patch.

tunic’s picture

Priority: Normal » Critical

Patch works ok, error is gone.

Raising to critical as the site is not working at all.

  • anirudhsingh19 committed ef5ac26e on 1.x
    Issue #3535765: Remove examples from slots and added description...

tunic’s picture

Status: Needs review » Fixed

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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