Argument 1 passed to Drupal\layout_builder_st\EventSubscriber\ComponentPluginTranslate::isTranslation() must implement interface Drupal\layout_builder\SectionStorageInterface, null given

Created on 24 July 2019, over 5 years ago
Updated 3 January 2025, 4 days ago

Hi,

I get the error above when an entity, using the layout builder, is supposed to render in a view mode other than "full", where the full view mode is not configured for this entity.

That's because the LayoutEntityHelperTrait currently always uses the view mode full as context. See: 🐛 Callers of LayoutEntityHelperTrait::getEntitySections() do not account for the view mode Needs work
Using the patch from there will allow to call the trait function getSectionStorageForEntity with a view mode as second parameter.

I created a patch for Drupal\layout_builder_st\EventSubscriber\ComponentPluginTranslate that will add the view mode to the trait function call, if present, thus fixed the error for me.

Hope this will help!

🐛 Bug report
Status

Needs work

Component

Code

Created by

🇩🇪Germany ktpm

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024