Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/Plugin/views/display/Eva.php b/src/Plugin/views/display/Eva.php
index a7b6d5f..487b115 100644
--- a/src/Plugin/views/display/Eva.php
+++ b/src/Plugin/views/display/Eva.php
@@ -10,6 +10,7 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\SafeMarkup;
use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\eva\ViewDisplays;
diff --git a/src/Plugin/views/display/Eva.php b/src/Plugin/views/display/Eva.php
index a7b6d5f..487b115 100644
--- a/src/Plugin/views/display/Eva.php
+++ b/src/Plugin/views/display/Eva.php
@@ -10,6 +10,7 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\SafeMarkup;
use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\eva\ViewDisplays;
diff --git a/src/Plugin/views/display/Eva.php b/src/Plugin/views/display/Eva.php
index a7b6d5f..487b115 100644
--- a/src/Plugin/views/display/Eva.php
+++ b/src/Plugin/views/display/Eva.php
@@ -10,6 +10,7 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\SafeMarkup;
use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\eva\ViewDisplays;
diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module
index 373f7d8a0f..20ea2ff3d5 100644
--- a/core/modules/layout_builder/layout_builder.module
+++ b/core/modules/layout_builder/layout_builder.module
@@ -106,7 +106,7 @@ function layout_builder_field_config_delete(FieldConfigInterface $field_config)
* @see layout_builder_module_implements_alter()
*/
function layout_builder_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
- if ($display instanceof LayoutEntityDisplayInterface) {
+ if ($entity->isLayoutBuilderEnabled() && ($display instanceof LayoutEntityDisplayInterface)) {
diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module
index 373f7d8a0f..20ea2ff3d5 100644
--- a/core/modules/layout_builder/layout_builder.module
+++ b/core/modules/layout_builder/layout_builder.module
@@ -106,7 +106,7 @@ function layout_builder_field_config_delete(FieldConfigInterface $field_config)
* @see layout_builder_module_implements_alter()
*/
function layout_builder_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
- if ($display instanceof LayoutEntityDisplayInterface) {
+ if ($entity->isLayoutBuilderEnabled() && ($display instanceof LayoutEntityDisplayInterface)) {
diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module
index 373f7d8a0f..20ea2ff3d5 100644
--- a/core/modules/layout_builder/layout_builder.module
+++ b/core/modules/layout_builder/layout_builder.module
@@ -106,7 +106,7 @@ function layout_builder_field_config_delete(FieldConfigInterface $field_config)
* @see layout_builder_module_implements_alter()
*/
function layout_builder_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
- if ($display instanceof LayoutEntityDisplayInterface) {
+ if ($entity->isLayoutBuilderEnabled() && ($display instanceof LayoutEntityDisplayInterface)) {
@ahebrank
ahebrank / layout-builder-alter-check.patch
Created December 9, 2018 17:58
Add an additional check to see whether layout builder is active
diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module
index 373f7d8a0f..48c668c856 100644
--- a/core/modules/layout_builder/layout_builder.module
+++ b/core/modules/layout_builder/layout_builder.module
@@ -106,7 +106,9 @@ function layout_builder_field_config_delete(FieldConfigInterface $field_config)
* @see layout_builder_module_implements_alter()
*/
function layout_builder_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
- if ($display instanceof LayoutEntityDisplayInterface) {
+ // Check third party layout builder enabled setting.
diff --git a/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php b/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
index 305e71b..1bebf84 100644
--- a/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
@@ -5,6 +5,7 @@ namespace Drupal\embederator\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Compnonent\Utility\Html;
diff --git a/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php b/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
index 305e71b..1bebf84 100644
--- a/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
@@ -5,6 +5,7 @@ namespace Drupal\embederator\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Compnonent\Utility\Html;
diff --git a/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php b/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
index 305e71b..cb6406f 100644
--- a/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/EmbederatorFormatter.php
@@ -5,6 +5,7 @@ namespace Drupal\embederator\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Compnonents\Utility\Html;