Verified Commit 3ef01036 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2822890 by danflanagan8, Peacog, Lendude, quietone, smustgrave,...

Issue #2822890 by danflanagan8, Peacog, Lendude, quietone, smustgrave, AaronMcHale, benjifisher: Taxonomy vocabulary translation local task tab not shown in UI

(cherry picked from commit 8c5fad98)
parent 46c3c5d9
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -190,6 +190,11 @@ protected function doVocabularyListTest() {
    // Test if the link to translate actually goes to the translate page.
    $this->drupalGet($translate_link);
    $this->assertSession()->responseContains('<th>Language</th>');

    // Test if the local task for translation is on this page.
    $this->assertSession()->linkExists('Translate taxonomy vocabulary');
    $local_task_url = parse_url($this->getSession()->getPage()->findLink('Translate taxonomy vocabulary')->getAttribute('href'));
    $this->assertSame(base_path() . $translate_link, $local_task_url['path']);
  }

  /**
+15 −0
Original line number Diff line number Diff line
@@ -72,6 +72,21 @@ function taxonomy_theme_suggestions_taxonomy_term(array $variables) {
  return $suggestions;
}

/**
 * Implements hook_local_tasks_alter().
 *
 * @todo Evaluate removing as part of https://www.drupal.org/node/2358923.
 */
function taxonomy_local_tasks_alter(&$local_tasks) {
  $local_task_key = 'config_translation.local_tasks:entity.taxonomy_vocabulary.config_translation_overview';
  if (isset($local_tasks[$local_task_key])) {
    // The config_translation module expects the base route to be
    // entity.taxonomy_vocabulary.edit_form like it is for other configuration
    // entities. Taxonomy uses the overview_form as the base route.
    $local_tasks[$local_task_key]['base_route'] = 'entity.taxonomy_vocabulary.overview_form';
  }
}

/**
 * Prepares variables for taxonomy term templates.
 *