Cannot access private property Drupal\sdc\Plugin\Component::$metadata

Created on 6 July 2023, 12 months ago
Updated 3 August 2023, 11 months ago

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

πŸ› Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria roromedia Linz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @roromedia
  • Status changed to Closed: cannot reproduce 11 months ago
  • e0ipso Can Picafort

    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.

  • πŸ‡¬πŸ‡§United Kingdom JennyDumitrescu

    @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.

  • πŸ‡¦πŸ‡ΉAustria roromedia Linz

    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!

Production build 0.69.0 2024