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)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | storybook-decorator-3491257-3.patch | 2.71 KB | rjjakes |
| #2 | storybook-decorator-3491257-2.patch | 3.11 KB | rjjakes |
Comments
Comment #2
rjjakes commentedComment #3
rjjakes commentedPrevious patch does not apply. This one does.
Comment #4
ajetiv1Thank you rjjakes, the patch fixed the issue and Storybook installed without errors or braking the site
Comment #5
e0ipsoThere is a lot of unnecessary stuff going on here. Can we restrict the patch to the issue at hand?
Comment #6
e0ipsoFor clarity, we only need to drop the `public: false` line for this patch.