Issue #2822890 by danflanagan8, Peacog, Lendude, quietone, smustgrave, AaronMcHale, benjifisher: Taxonomy vocabulary translation local task tab not shown in UI
							parent
							
								
									8ae0a0230f
								
							
						
					
					
						commit
						8c5fad9808
					
				| 
						 | 
				
			
			@ -192,6 +192,11 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
 | 
			
		|||
    // 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']);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,6 +73,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.
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue