Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296340

Call to undefined method isLayoutBuilderEnabled()

$
0
0

Steps to reproduce

Drupal 9.3.2, with Layout Builder and Display Suite 8.x-3.13 enabled.
I've choose a DisplaySuite layout in a content form display.
Then, I cant' display content.

Problem/Motivation

Error: Call to undefined method Drupal\Core\Entity\Entity\EntityViewDisplay::isLayoutBuilderEnabled() in Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->isLayoutBuilderEnabled() (line 330 of core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php).
Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->isLayoutBuilderEnabled() (Line: 382)
Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->access() (Line: 362)
Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage->access() (Line: 37)
Drupal\layout_builder\Access\LayoutBuilderAccessCheck->access()
....

Proposed resolution

To work around the problem, not being a Drupal developer, I simply added the missing method such as:

namespace Drupal\Core\Entity\Entity;
...
class EntityViewDisplay extends EntityDisplayBase implements EntityViewDisplayInterface {
...
  public function isLayoutBuilderEnabled() {
	return \Drupal::moduleHandler()->moduleExists('layout_builder') ;
  }
...
}

Viewing all articles
Browse latest Browse all 296340

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>