diff --git a/core/modules/taxonomy/src/Form/OverviewTerms.php b/core/modules/taxonomy/src/Form/OverviewTerms.php index 19030a47cbfb5e04121e47b216cd798ac5f0d22d..eaa203077528c280110c488856e19c3b703dcd39 100644 --- a/core/modules/taxonomy/src/Form/OverviewTerms.php +++ b/core/modules/taxonomy/src/Form/OverviewTerms.php @@ -326,6 +326,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular '#empty' => $empty, '#header' => [ 'term' => $this->t('Name'), + 'status' => $this->t('Status'), 'operations' => $this->t('Operations'), 'weight' => !$operations_access ? $this->t('Weight') : NULL, ], @@ -338,6 +339,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular foreach ($current_page as $key => $term) { $form['terms'][$key] = [ 'term' => [], + 'status' => [], 'operations' => [], 'weight' => $update_tree_access->isAllowed() ? [] : NULL, ]; @@ -357,6 +359,10 @@ public function buildForm(array $form, FormStateInterface $form_state, Vocabular '#title' => $term->getName(), '#url' => $term->toUrl(), ]; + $form['terms'][$key]['status'] = [ + '#type' => 'item', + '#markup' => ($term->isPublished()) ? t('Published') : t('Unpublished'), + ]; // Add a special class for terms with pending revision so we can highlight // them in the form. diff --git a/core/modules/taxonomy/tests/src/Functional/TermTest.php b/core/modules/taxonomy/tests/src/Functional/TermTest.php index 26137071ab561adf1ea81f3de46b3a31ce279c16..6c731976e1670254ba5fe90c02bd0ed2eccbd7db 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermTest.php @@ -385,6 +385,13 @@ public function testTermInterface() { $this->assertSession()->pageTextContains($edit['name[0][value]']); $this->assertSession()->linkExists('Edit'); + // Unpublish the term. + $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); + $this->submitForm(["status[value]" => 0], 'Save'); + // Check that the term is now unpublished in the list. + $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); + $this->assertSession()->elementTextContains('css', "#edit-terms-tid{$term->id()}0-status", 'Unpublished'); + // Check the term link can be clicked through to the term page. $this->clickLink($edit['name[0][value]']); $this->assertSession()->statusCodeEquals(200);