Problem/Motivation

Currently every request to the cl_server ends in an error 500, because of the following error message:

Error: Cannot access private property Drupal\sdc\Plugin\Component::$metadata in Drupal\cl_server\Controller\ServerEndpointController->generateRenderArray() (line 137 of modules/contrib/cl_server/src/Controller/ServerEndpointController.php).

Steps to reproduce

Install/update to latest version and try to show a component in storybook.

Proposed resolution

Changing all instances of $component->metadata to $component->getMetadata() resolves this issue.
I am wondering why this works for other users maybe someone is able to point me in the right direction how this could be resolved differently.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

roromedia created an issue. See original summary.

e0ipso’s picture

Status: Active » Closed (cannot reproduce)

I think this is using an older version of contrib SDC. The getMetadata method was dropped a while ago in favor of the public property.

jennydumitrescu’s picture

StatusFileSize
new626.24 KB

@e0ipso - I'm currently recreating this trying to set up storybook/drupal with the following:

Drupal 10.1.1
SDC module - 2.0.0-alpha4
CL_server - 2.0.0-beta3

I am new to Storybook/CL Servre so am unsure it could be a setup issue on my side too but I wanted to say that I'm recreating it with the most recent SDC. Happy to help with a debug and pass on a platform. I've added a screenshot of the error.

roromedia’s picture

Hi Jenny,
If you do a fresh setup you should not install the contributed SDC-module. This module is in core, you just need to enable it under "Extend" in your installation.
I would suggest you do the following:
1) Deinstall contrib/sdc-module either via drush: drush pmu sdc or through the module uninstall interface.
2) Enable the core sdc module under "Extend"

Afterwards it worked on my setup.

Good luck!