X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FQuery%2FSql%2FTables.php;h=1f99d0f7716b74c734e6ffb99d7fa750964fee5a;hp=a9ff4b136dcc6aac9f4e0db3b6944b12e889a865;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hpb=9424afc6c1f518c301bf87a23c047d1873435d05 diff --git a/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php index a9ff4b136..1f99d0f77 100644 --- a/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php +++ b/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php @@ -184,6 +184,7 @@ class Tables implements TablesInterface { // finds the property first. The data table is preferred, which is why // it gets added before the base table. $entity_tables = []; + $revision_table = NULL; if ($all_revisions && $field_storage && $field_storage->isRevisionable()) { $data_table = $entity_type->getRevisionDataTable(); $entity_base_table = $entity_type->getRevisionTable(); @@ -191,11 +192,18 @@ class Tables implements TablesInterface { else { $data_table = $entity_type->getDataTable(); $entity_base_table = $entity_type->getBaseTable(); + + if ($field_storage && $field_storage->isRevisionable() && in_array($field_storage->getName(), $entity_type->getRevisionMetadataKeys())) { + $revision_table = $entity_type->getRevisionTable(); + } } if ($data_table) { $this->sqlQuery->addMetaData('simple_query', FALSE); $entity_tables[$data_table] = $this->getTableMapping($data_table, $entity_type_id); } + if ($revision_table) { + $entity_tables[$revision_table] = $this->getTableMapping($revision_table, $entity_type_id); + } $entity_tables[$entity_base_table] = $this->getTableMapping($entity_base_table, $entity_type_id); $sql_column = $specifier;