X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FForm%2FOverviewTerms.php;fp=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FForm%2FOverviewTerms.php;h=f9e0d595982e6ef0e299ea708bcf7115e9399212;hp=df80a47035be0b522cbfd9cdf0809726bb8db4cb;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/taxonomy/src/Form/OverviewTerms.php b/web/core/modules/taxonomy/src/Form/OverviewTerms.php index df80a4703..f9e0d5959 100644 --- a/web/core/modules/taxonomy/src/Form/OverviewTerms.php +++ b/web/core/modules/taxonomy/src/Form/OverviewTerms.php @@ -241,6 +241,11 @@ class OverviewTerms extends FormBase { $form['terms'] = [ '#type' => 'table', '#empty' => $empty, + '#header' => [ + 'term' => $this->t('Name'), + 'operations' => $this->t('Operations'), + 'weight' => $this->t('Weight'), + ], '#attributes' => [ 'id' => 'taxonomy', ], @@ -251,6 +256,11 @@ class OverviewTerms extends FormBase { // all terms. $change_weight_access = AccessResult::allowed(); foreach ($current_page as $key => $term) { + $form['terms'][$key] = [ + 'term' => [], + 'operations' => [], + 'weight' => [], + ]; /** @var $term \Drupal\Core\Entity\EntityInterface */ $term = $this->entityManager->getTranslationFromContext($term); $form['terms'][$key]['#term'] = $term; @@ -344,11 +354,8 @@ class OverviewTerms extends FormBase { $row_position++; } - $form['terms']['#header'] = [$this->t('Name')]; - $this->renderer->addCacheableDependency($form['terms'], $change_weight_access); if ($change_weight_access->isAllowed()) { - $form['terms']['#header'][] = $this->t('Weight'); if ($parent_fields) { $form['terms']['#tabledrag'][] = [ 'action' => 'match', @@ -377,8 +384,6 @@ class OverviewTerms extends FormBase { ]; } - $form['terms']['#header'][] = $this->t('Operations'); - if (($taxonomy_vocabulary->getHierarchy() !== VocabularyInterface::HIERARCHY_MULTIPLE && count($tree) > 1) && $change_weight_access->isAllowed()) { $form['actions'] = ['#type' => 'actions', '#tree' => FALSE]; $form['actions']['submit'] = [ @@ -492,7 +497,7 @@ class OverviewTerms extends FormBase { $vocabulary->setHierarchy($hierarchy); $vocabulary->save(); } - drupal_set_message($this->t('The configuration options have been saved.')); + $this->messenger()->addStatus($this->t('The configuration options have been saved.')); } /**