diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index c0e292db29945b3ee4864d767b5fd841fa1f4a00..143962fefd0568d20f51192f8930ee18033469bf 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -138,9 +138,10 @@ function taxonomy_update_8601() {
// Bail out early if a field named 'status' is already installed.
if ($definition_update_manager->getFieldStorageDefinition('status', 'taxonomy_term')) {
- return t('The publishing status field has not been added to taxonomy terms. See this page for more information on how to install it.', [
+ $message = \Drupal::state()->get('taxonomy_update_8601_skip_message', t('The publishing status field has not been added to taxonomy terms. See this page for more information on how to install it.', [
':link' => 'https://www.drupal.org/node/2985366',
- ]);
+ ]));
+ return $message;
}
// Add the 'published' entity key to the taxonomy_term entity type.
diff --git a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php
index 87ad2a7b380dff2b0a703ec3db16c63f0746fe27..55f14915a7725deddd504ab66b8b150d9a7565bf 100644
--- a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php
@@ -80,6 +80,13 @@ public function testPublishable() {
$term->save();
$term = $storage->loadUnchanged($term->id());
$this->assertFalse($term->isPublished());
+
+ // Test the update does not run when a status field already exists.
+ module_load_install('taxonomy');
+ $this->assertEquals('The publishing status field has not been added to taxonomy terms. See this page for more information on how to install it.', (string) taxonomy_update_8601());
+ // Test the message can be overridden.
+ \Drupal::state()->set('taxonomy_update_8601_skip_message', 'Another message');
+ $this->assertEquals('Another message', (string) taxonomy_update_8601());
}
/**