diff --git a/core/lib/Drupal/Core/Entity/RevisionableSchemaConverter.php b/core/lib/Drupal/Core/Entity/RevisionableSchemaConverter.php index 6b36e34..2d58dd1 100644 --- a/core/lib/Drupal/Core/Entity/RevisionableSchemaConverter.php +++ b/core/lib/Drupal/Core/Entity/RevisionableSchemaConverter.php @@ -67,9 +67,9 @@ public function copyData(EntityTypeInterface $entity_type, array &$sandbox) { $sandbox['progress'] = 0; $sandbox['current_id'] = 0; $sandbox['max'] = $this->database->select($base_table) - ->countQuery() - ->execute() - ->fetchField(); + ->countQuery() + ->execute() + ->fetchField(); } /** @var \Drupal\Core\Entity\Sql\TableMappingInterface $table_mapping */ @@ -114,7 +114,7 @@ public function copyData(EntityTypeInterface $entity_type, array &$sandbox) { ->condition($id, $record[$id]) ->execute() ->fetchAll(); - if (isset($exists) && isset($exists[0]) && ($exists[0]->{$id} == $record[$id])) { + if ($exists && isset($exists[0]) && ($exists[0]->{$id} == $record[$id])) { $this->database ->update($table_name) ->fields($values) diff --git a/core/lib/Drupal/Core/Entity/RevisionableSchemaConverterInterface.php b/core/lib/Drupal/Core/Entity/RevisionableSchemaConverterInterface.php index 0b21238..41d7bab 100644 --- a/core/lib/Drupal/Core/Entity/RevisionableSchemaConverterInterface.php +++ b/core/lib/Drupal/Core/Entity/RevisionableSchemaConverterInterface.php @@ -8,6 +8,7 @@ * Converts the schema to be revisionable. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type + * The entity type to convert. */ public function convertSchema(EntityTypeInterface $entity_type); @@ -15,7 +16,9 @@ public function convertSchema(EntityTypeInterface $entity_type); * Copies existing data to new tables. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type + * The entity type for the data that needs copying. * @param array $sandbox + * The sandbox array from hook_update(). */ public function copyData(EntityTypeInterface $entity_type, array &$sandbox); diff --git a/core/tests/Drupal/Tests/Core/Entity/RevisionableSchemaConverterTest.php b/core/tests/Drupal/Tests/Core/Entity/RevisionableSchemaConverterTest.php index 7cfaa9f..16f1c1e 100644 --- a/core/tests/Drupal/Tests/Core/Entity/RevisionableSchemaConverterTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/RevisionableSchemaConverterTest.php @@ -15,7 +15,7 @@ class RevisionableSchemaConverterTest extends UpdatePathTestBase { * @inheritDoc */ protected function setDatabaseDumpFiles() { - $this->databaseDumpFiles = [__DIR__ . '/../../../../../modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz']; + $this->databaseDumpFiles = [__DIR__ . '/../../../../../modules/system/tests/fixtures/update/drupal-8.filled.standard.php.gz']; } public function testMakeRevisionable() {