Commit f8e984c1 authored by plach's avatar plach

Issue #3048950 by catch, bkildow, alexpott: ...

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 835ba7fc)
parent 7454f127
...@@ -248,9 +248,11 @@ function _layout_builder_bundle_has_no_layouts($entity_type_id, $bundle) { ...@@ -248,9 +248,11 @@ function _layout_builder_bundle_has_no_layouts($entity_type_id, $bundle) {
if ($bundle_key) { if ($bundle_key) {
$query->condition($bundle_key, $bundle); $query->condition($bundle_key, $bundle);
} }
if ($entity_type->isRevisionable()) {
$query->allRevisions();
}
$query->exists(OverridesSectionStorage::FIELD_NAME) $query->exists(OverridesSectionStorage::FIELD_NAME)
->accessCheck(FALSE) ->accessCheck(FALSE)
->allRevisions()
->range(0, 1); ->range(0, 1);
$results = $query->execute(); $results = $query->execute();
return empty($results); return empty($results);
...@@ -279,9 +281,11 @@ function _layout_builder_bundle_has_no_translations($entity_type_id, $bundle) { ...@@ -279,9 +281,11 @@ function _layout_builder_bundle_has_no_translations($entity_type_id, $bundle) {
if ($bundle_key) { if ($bundle_key) {
$query->condition($bundle_key, $bundle); $query->condition($bundle_key, $bundle);
} }
if ($entity_type->isRevisionable()) {
$query->allRevisions();
}
$query->condition($entity_type->getKey('default_langcode'), 0) $query->condition($entity_type->getKey('default_langcode'), 0)
->accessCheck(FALSE) ->accessCheck(FALSE)
->allRevisions()
->range(0, 1); ->range(0, 1);
$results = $query->execute(); $results = $query->execute();
return empty($results); return empty($results);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment