Commit 46e89b99 authored by xjm's avatar xjm

Issue #2752849 by pixelmord, ChandeepKhosa, ifrik, xjm: Display vocabulary...

Issue #2752849 by pixelmord, ChandeepKhosa, ifrik, xjm: Display vocabulary description on Taxonomy page
parent dd1c1ce6
......@@ -47,14 +47,17 @@ function testVocabularyInterface() {
// 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;
......
......@@ -56,6 +56,7 @@ public function getDefaultOperations(EntityInterface $entity) {
*/
public function buildHeader() {
$header['label'] = t('Vocabulary name');
$header['description'] = t('Description');
return $header + parent::buildHeader();
}
......@@ -64,6 +65,7 @@ public function buildHeader() {
*/
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity->label();
$row['description']['data'] = ['#markup' => $entity->getDescription()];
return $row + parent::buildRow($entity);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment