Loading core/lib/Drupal/Core/Theme/Component/ComponentValidator.php +8 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,14 @@ public function validateDefinition(array $definition, bool $enforce_schemas): bo $schema['properties'] = new \stdClass(); } // If a slot has an empty definition, // force casting to object instead of array. foreach ($definition['slots'] ?? [] as $slot_name => $slot) { if ($slot === []) { $definition['slots'][$slot_name] = new \stdClass(); } } // Ensure that all property types are strings. For example, a null value // will not automatically convert to 'null', which will lead to a PHP error // that is hard to trace back to the property. Loading core/modules/system/tests/modules/sdc_test/components/my-banner/my-banner.component.yml +1 −0 Original line number Diff line number Diff line Loading @@ -43,3 +43,4 @@ slots: description: The contents of the banner. examples: - <p>Foo is <strong>NOT</strong> bar.</p> minimal: { } Loading
core/lib/Drupal/Core/Theme/Component/ComponentValidator.php +8 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,14 @@ public function validateDefinition(array $definition, bool $enforce_schemas): bo $schema['properties'] = new \stdClass(); } // If a slot has an empty definition, // force casting to object instead of array. foreach ($definition['slots'] ?? [] as $slot_name => $slot) { if ($slot === []) { $definition['slots'][$slot_name] = new \stdClass(); } } // Ensure that all property types are strings. For example, a null value // will not automatically convert to 'null', which will lead to a PHP error // that is hard to trace back to the property. Loading
core/modules/system/tests/modules/sdc_test/components/my-banner/my-banner.component.yml +1 −0 Original line number Diff line number Diff line Loading @@ -43,3 +43,4 @@ slots: description: The contents of the banner. examples: - <p>Foo is <strong>NOT</strong> bar.</p> minimal: { }