summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2016-08-03 00:36:39 (GMT)
committerxjm2016-08-03 00:36:39 (GMT)
commit46e89b9919e629e70feefae941cc717742c4c210 (patch)
tree0c9152cfd54e506dd8c8b2d585e857ac2668837f
parentdd1c1ce6d594a62701720721d6b7e97ff2bdd176 (diff)
Issue #2752849 by pixelmord, ChandeepKhosa, ifrik, xjm: Display vocabulary description on Taxonomy page
-rw-r--r--core/modules/taxonomy/src/Tests/VocabularyUiTest.php7
-rw-r--r--core/modules/taxonomy/src/VocabularyListBuilder.php2
2 files changed, 7 insertions, 2 deletions
diff --git a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
index 3066ef0..76fcac2 100644
--- a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
+++ b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
@@ -47,14 +47,17 @@ class VocabularyUiTest extends TaxonomyTestBase {
// Edit the vocabulary.
$this->drupalGet('admin/structure/taxonomy');
- $this->assertText($edit['name'], 'Vocabulary found in the vocabulary overview listing.');
+ $this->assertText($edit['name'], 'Vocabulary name found in the vocabulary overview listing.');
+ $this->assertText($edit['description'], 'Vocabulary description found in the vocabulary overview listing.');
$this->assertLinkByHref(Url::fromRoute('entity.taxonomy_term.add_form', ['taxonomy_vocabulary' => $edit['vid']])->toString());
$this->clickLink(t('Edit vocabulary'));
$edit = array();
$edit['name'] = $this->randomMachineName();
+ $edit['description'] = $this->randomMachineName();
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->drupalGet('admin/structure/taxonomy');
- $this->assertText($edit['name'], 'Vocabulary found in the vocabulary overview listing.');
+ $this->assertText($edit['name'], 'Vocabulary name found in the vocabulary overview listing.');
+ $this->assertText($edit['description'], 'Vocabulary description found in the vocabulary overview listing.');
// Try to submit a vocabulary with a duplicate machine name.
$edit['vid'] = $vid;
diff --git a/core/modules/taxonomy/src/VocabularyListBuilder.php b/core/modules/taxonomy/src/VocabularyListBuilder.php
index b5597bb..9c24311 100644
--- a/core/modules/taxonomy/src/VocabularyListBuilder.php
+++ b/core/modules/taxonomy/src/VocabularyListBuilder.php
@@ -56,6 +56,7 @@ class VocabularyListBuilder extends DraggableListBuilder {
*/
public function buildHeader() {
$header['label'] = t('Vocabulary name');
+ $header['description'] = t('Description');
return $header + parent::buildHeader();
}
@@ -64,6 +65,7 @@ class VocabularyListBuilder extends DraggableListBuilder {
*/
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity->label();
+ $row['description']['data'] = ['#markup' => $entity->getDescription()];
return $row + parent::buildRow($entity);
}