Issue #3048950 by catch, bkildow, alexpott: layout_builder_post_update_make_layout_untranslatable() attempts to query all revisions for non-revisionable entities

merge-requests/1119/head
Francesco Placella 2019-04-18 12:43:50 +02:00
parent e593d72572
commit 835ba7fcce
1 changed files with 6 additions and 2 deletions

View File

@ -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);