core/modules/book/src/Controller/BookController.php | 2 +- core/modules/dblog/src/Tests/Views/ViewsIntegrationTest.php | 9 ++++++--- core/modules/taxonomy/src/TermForm.php | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php index 4eb1413..cc9b793 100644 --- a/core/modules/book/src/Controller/BookController.php +++ b/core/modules/book/src/Controller/BookController.php @@ -73,7 +73,7 @@ public function adminOverview() { foreach ($this->bookManager->getAllBooks() as $book) { /** @var \Drupal\Core\Url $url */ $url = $book->urlInfo(); - if (!isset($book['options'])) { + if (isset($book['options'])) { $url->setOptions($book['options']); } $row = array( diff --git a/core/modules/dblog/src/Tests/Views/ViewsIntegrationTest.php b/core/modules/dblog/src/Tests/Views/ViewsIntegrationTest.php index 5df9929..7878f00 100644 --- a/core/modules/dblog/src/Tests/Views/ViewsIntegrationTest.php +++ b/core/modules/dblog/src/Tests/Views/ViewsIntegrationTest.php @@ -40,6 +40,9 @@ class ViewsIntegrationTest extends ViewUnitTestBase { protected function setUp() { parent::setUp(); + // Rebuild the router, otherwise we can't generate links. + $this->container->get('router.builder')->rebuild(); + $this->installSchema('dblog', array('watchdog')); ViewTestData::createTestViews(get_class($this), array('dblog_test_views')); @@ -57,12 +60,12 @@ public function testIntegration() { // Setup a watchdog entry without tokens. $entries[] = array( 'message' => $this->randomMachineName(), - 'variables' => array('link' => \Drupal::l('Link', 'entity.node.canonical', ['node' => 1])), + 'variables' => array('link' => \Drupal::l('Link', '')), ); // Setup a watchdog entry with one token. $entries[] = array( 'message' => '@token1', - 'variables' => array('@token1' => $this->randomMachineName(), 'link' => \Drupal::l('Link', 'entity.node.canonical', ['node' => 2])), + 'variables' => array('@token1' => $this->randomMachineName(), 'link' => \Drupal::l('Link', '')), ); // Setup a watchdog entry with two tokens. $entries[] = array( @@ -72,7 +75,7 @@ public function testIntegration() { 'variables' => array( '@token1' => $this->randomMachineName(), '!token2' => $this->randomMachineName(), - 'link' => \Drupal::l('Link', 'entity.node.canonical', ['node' => 2], ['html' => TRUE]), + 'link' => \Drupal::l('Link', ''), ), ); $logger_factory = $this->container->get('logger.factory'); diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index 1de3ea1..ea2a96e 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -134,8 +134,10 @@ public function buildEntity(array $form, FormStateInterface $form_state) { public function save(array $form, FormStateInterface $form_state) { $term = $this->entity; + $result = $term->save(); + $link = \Drupal::linkGenerator()->generateFromUrl($this->t('Edit'), $term->urlInfo('edit-form')); - switch ($term->save()) { + switch ($result) { case SAVED_NEW: drupal_set_message($this->t('Created new term %term.', array('%term' => $term->getName()))); $this->logger('taxonomy')->notice('Created new term %term.', array('%term' => $term->getName(), 'link' => $link));