diff --git a/core/modules/block_content/block_content.install b/core/modules/block_content/block_content.install index f3441ec..6b1c397 100644 --- a/core/modules/block_content/block_content.install +++ b/core/modules/block_content/block_content.install @@ -64,15 +64,21 @@ function block_content_update_8003() { } /** + * @addtogroup updates-8.3.x + * @{ + */ + +/** * Add and populate publishing status fields. */ -function block_content_update_8004() { - $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('block_content'); +function block_content_update_8300() { + $manager = \Drupal::entityDefinitionUpdateManager(); + $entity_type = $manager->getEntityType('block_content'); $entity_keys = $entity_type->getKeys(); $entity_keys['published'] = 'status'; $entity_type->set('entity_keys', $entity_keys); $entity_type->setHandlerClass('storage_schema', 'Drupal\block_content\BlockContentStorageSchema'); - \Drupal::entityDefinitionUpdateManager()->updateEntityType($entity_type); + $manager->updateEntityType($entity_type); $status = BaseFieldDefinition::create('boolean') ->setLabel(new TranslatableMarkup('Publishing status')) @@ -81,7 +87,10 @@ function block_content_update_8004() { ->setTranslatable(TRUE) ->setDefaultValue(TRUE); - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('status', 'block_content', 'block_content', $status); + $manager->installFieldStorageDefinition('status', 'block_content', 'block_content', $status); } + +/** + * @} End of "addtogroup updates-8.3.x". + */ diff --git a/core/modules/block_content/src/Tests/Update/BlockContentUpdateTest.php b/core/modules/block_content/src/Tests/Update/BlockContentUpdateTest.php index 5415d5a..c0ba15f 100644 --- a/core/modules/block_content/src/Tests/Update/BlockContentUpdateTest.php +++ b/core/modules/block_content/src/Tests/Update/BlockContentUpdateTest.php @@ -23,12 +23,12 @@ protected function setDatabaseDumpFiles() { /** * Tests adding a status field to the block content entity type. * - * @see block_content_update_8004() + * @see block_content_update_8300() */ public function testStatusField() { // Check that the 'status' field does not exist prior to the update. $field = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('status', 'block_content'); - $this->assertIdentical(NULL, $field); + $this->assertNull($field); // Run updates. $this->runUpdates();