Problem/Motivation

I added storybook to an install profile along with the

On site install, I got the error

In MemoryBackend.php line 123:

Serialization of 'Closure' is not allowed

I tracked this error to ComponentSelectorElement inside https://www.drupal.org/project/cl_editorial
This file uses the FileUrlGenerator service which is being overridden in storybook via a Synfony service decorator

  Drupal\storybook\FileUrlGenerator:
    decorates: file_url_generator
    public: false
    arguments: ['@Drupal\storybook\FileUrlGenerator.inner', '@request_stack']

If I remove this service decorator, cl_editorial installs fine. This leads to believe there is an issue in how the Synfony decorator layer is handling \Drupal\storybook\FileUrlGenerator

If I simplify the service decorator and set the storybook service to public (see patch) the cl_editorial module installs just fine and \Drupal\storybook\FileUrlGenerator works as intended (making absolute URL paths).

I'm not fully convinced this is an issue with Storybook, but am hoping someone with more knowledge of the Symfony service decorator layer can help me understand whats' going on.

Steps to reproduce

Create an install profile with https://www.drupal.org/project/cl_editorial (3.0.0-rc2) and https://www.drupal.org/project/storybook (1.0.2)

Comments

rjjakes created an issue. See original summary.

rjjakes’s picture

StatusFileSize
new3.11 KB
rjjakes’s picture

StatusFileSize
new2.71 KB

Previous patch does not apply. This one does.

ajetiv1’s picture

Thank you rjjakes, the patch fixed the issue and Storybook installed without errors or braking the site

e0ipso’s picture

Status: Active » Needs work

There is a lot of unnecessary stuff going on here. Can we restrict the patch to the issue at hand?

e0ipso’s picture

For clarity, we only need to drop the `public: false` line for this patch.