Skip to content
Snippets Groups Projects
Commit 46e89b99 authored by Jess's avatar Jess
Browse files

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

Issue #2752849 by pixelmord, ChandeepKhosa, ifrik, xjm: Display vocabulary description on Taxonomy page
parent dd1c1ce6
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment