- Issue created by @mortona2k
- πΊπΈUnited States mortona2k Seattle
The error is actually in cl_editorial, ComponentInputToForm::buildForm(), line 62.
With no props in component.yml, $schema is null on this line. It's fixable by checking if(!empty($schema)), but I'm not sure that's the best way to go.
With empty props defined in component.yml, the check has to be if(!empty($shema) && !empty($schema->properties)).
- Status changed to Fixed
9 months ago 6:46am 24 February 2024 - e0ipso Can Picafort
Hi again @mortona2k! It seems like yesterday we were chatting in Pittsburgh.
Component schema is mandatory for integration with SDC Display. The way to declare empty props is not by leaving them out but by actually saying they are empty. Perhaps a schema like this would work:
$schema: https://git.drupalcode.org/project/sdc/-/raw/1.x/src/metadata.schema.json name: Info Card props: type: object properties: {} slots: card_title: title: Card title card_year: title: Card year content: title: Content
Thanks to this report, I have created an F.A.Q. entry in our documentation. I hope this fixes your issue. https://www.drupal.org/docs/develop/theming-drupal/using-single-director... β
I think this is an error message we should work on in core, so it doesn't blow up in contrib. Do you know if you had validation turned on in your local environment? If so, did it show any validation error based on the empty
props
declaration? I think we should have an issue for Drupal core to provide a good error message for this, to avoid tripping more people. Can you create this issue and shoot me the link in Slack?Additionally, I think we also need an issue for https://github.com/e0ipso/schema-forms-php to provide a useful error message when validation is turned off for SDC in Drupal. Would you also create that one please? π
Automatically closed - issue fixed for 2 weeks with no activity.