From f8e984c1b2c6b440f50019e521b31cc4e1e31941 Mon Sep 17 00:00:00 2001 From: Francesco Placella Date: Thu, 18 Apr 2019 12:43:50 +0200 Subject: [PATCH] Issue #3048950 by catch, bkildow, alexpott: layout_builder_post_update_make_layout_untranslatable() attempts to query all revisions for non-revisionable entities (cherry picked from commit 835ba7fcce26bec7254ec4f58b2540666163a97a) --- .../modules/layout_builder/layout_builder.post_update.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/modules/layout_builder/layout_builder.post_update.php b/core/modules/layout_builder/layout_builder.post_update.php index cc6ae9095c..d52d56c2c0 100644 --- a/core/modules/layout_builder/layout_builder.post_update.php +++ b/core/modules/layout_builder/layout_builder.post_update.php @@ -248,9 +248,11 @@ function _layout_builder_bundle_has_no_layouts($entity_type_id, $bundle) { if ($bundle_key) { $query->condition($bundle_key, $bundle); } + if ($entity_type->isRevisionable()) { + $query->allRevisions(); + } $query->exists(OverridesSectionStorage::FIELD_NAME) ->accessCheck(FALSE) - ->allRevisions() ->range(0, 1); $results = $query->execute(); return empty($results); @@ -279,9 +281,11 @@ function _layout_builder_bundle_has_no_translations($entity_type_id, $bundle) { if ($bundle_key) { $query->condition($bundle_key, $bundle); } + if ($entity_type->isRevisionable()) { + $query->allRevisions(); + } $query->condition($entity_type->getKey('default_langcode'), 0) ->accessCheck(FALSE) - ->allRevisions() ->range(0, 1); $results = $query->execute(); return empty($results); -- 2.22.2