Commit a9b27b51 authored by webchick's avatar webchick

Issue #2465425 by jibran, pjonckiere, idebr: Vocabulary listing missing add taxonomy term link

parent 3e58aba8
......@@ -8,6 +8,7 @@
namespace Drupal\taxonomy\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Url;
use Drupal\taxonomy\Entity\Vocabulary;
/**
......@@ -50,6 +51,7 @@ function testVocabularyInterface() {
// Edit the vocabulary.
$this->drupalGet('admin/structure/taxonomy');
$this->assertText($edit['name'], 'Vocabulary 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();
......
......@@ -10,6 +10,7 @@
use Drupal\Core\Config\Entity\DraggableListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
/**
* Defines a class to build a listing of taxonomy vocabulary entities.
......@@ -48,7 +49,7 @@ public function getDefaultOperations(EntityInterface $entity) {
$operations['add'] = array(
'title' => t('Add terms'),
'weight' => 10,
'url' => $entity->urlInfo('add-form'),
'url' => Url::fromRoute('entity.taxonomy_term.add_form', ['taxonomy_vocabulary' => $entity->id()]),
);
unset($operations['delete']);
......
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