diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index d76c132..8f3b1ed 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -124,10 +124,12 @@ protected function installedStorageSchema() { * {@inheritdoc} */ public function requiresEntityStorageSchemaChanges(EntityTypeInterface $entity_type, EntityTypeInterface $original) { - return - $this->hasSharedTableStructureChange($entity_type, $original) || - // Detect changes in key or index definitions. - $this->getEntitySchemaData($entity_type, $this->getEntitySchema($entity_type, TRUE)) != $this->loadEntitySchemaData($original); + $shared = $this->hasSharedTableStructureChange($entity_type, $original); + // Detect changes in key or index definitions. + $new = $this->getEntitySchemaData($entity_type, $this->getEntitySchema($entity_type, TRUE)); + $old = $this->loadEntitySchemaData($original); + $key_index = $new != $old; + return $shared || $key_index; } /** @@ -143,10 +145,10 @@ public function requiresEntityStorageSchemaChanges(EntityTypeInterface $entity_t * a table has been renamed. */ protected function hasSharedTableStructureChange(EntityTypeInterface $entity_type, EntityTypeInterface $original) { - return - $entity_type->isRevisionable() != $original->isRevisionable() || - $entity_type->isTranslatable() != $original->isTranslatable() || - $this->hasSharedTableNameChanges($entity_type, $original); + $isRevisionable = $entity_type->isRevisionable() != $original->isRevisionable(); + $isTranslatable = $entity_type->isTranslatable() != $original->isTranslatable(); + $hasSharedTableNameChanges = $this->hasSharedTableNameChanges($entity_type, $original); + return $isRevisionable || $isTranslatable || $hasSharedTableNameChanges; } /** diff --git a/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php b/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php index 88db403..06ad5e3 100644 --- a/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php @@ -107,6 +107,7 @@ public function testTerm() { 'value' => $this->randomMachineName(), 'format' => $this->randomMachineName(), ), + 'revision_log_message' => $this->randomString(), 'parent' => $term_parent->id(), ]); $term->save(); @@ -164,6 +165,7 @@ public function testComment() { 'entity_id' => $node->id(), 'entity_type' => 'node', 'field_name' => 'comment', + 'revision_log_message' => $this->randomString(), )); $parent_comment->save(); @@ -180,6 +182,7 @@ public function testComment() { 'pid' => $parent_comment->id(), 'mail' => 'dries@drupal.org', 'homepage' => 'http://buytaert.net', + 'revision_log_message' => $this->randomString(), )); $comment->save(); diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php index 15ecf1f..aafef7c 100644 --- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php +++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php @@ -239,7 +239,7 @@ function testInstallConfig() { */ function testEnableModulesFixedList() { // Install system module. - $this->container->get('module_installer')->install(array('system', 'menu_link_content')); + $this->container->get('module_installer')->install(array('system', 'menu_link_content', 'user')); $entity_manager = \Drupal::entityManager(); // entity_test is loaded via $modules; its entity type should exist.