diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php index 941b8f0..0f70800 100644 --- a/core/modules/aggregator/src/Controller/AggregatorController.php +++ b/core/modules/aggregator/src/Controller/AggregatorController.php @@ -121,7 +121,7 @@ public function adminOverview() { $rows = array(); foreach ($feeds as $feed) { $row = array(); - $row[] = \Drupal::linkGenerator()->generateFromUrl($feed->label(), $feed->urlInfo()); + $row[] = $this->getLinkGenerator()->generateFromUrl($feed->label(), $feed->urlInfo()); $row[] = $this->dateFormatter->formatInterval($entity_manager->getStorage('aggregator_item')->getItemCount($feed), '1 item', '@count items'); $last_checked = $feed->getLastCheckedTime(); $refresh_rate = $feed->getRefreshRate(); diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php index cc9b793..1c23b50 100644 --- a/core/modules/book/src/Controller/BookController.php +++ b/core/modules/book/src/Controller/BookController.php @@ -77,7 +77,7 @@ public function adminOverview() { $url->setOptions($book['options']); } $row = array( - \Drupal::linkGenerator()->generateFromUrl($book['title'], $url), + $this->getLinkGenerator()->generateFromUrl($book['title'], $url), ); $links = array(); $links['edit'] = array( @@ -110,7 +110,7 @@ public function adminOverview() { public function bookRender() { $book_list = array(); foreach ($this->bookManager->getAllBooks() as $book) { - $book_list[] = \Drupal::linkGenerator()->generateFromUrl($book['title'], $book['url']); + $book_list[] = $this->getLinkGenerator()->generateFromUrl($book['title'], $book['url']); } return array( '#theme' => 'item_list', diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php index a3056f1..973f44a 100644 --- a/core/modules/book/src/Form/BookAdminEditForm.php +++ b/core/modules/book/src/Form/BookAdminEditForm.php @@ -121,7 +121,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $node->book['link_title'] = $values['title']; $node->setNewRevision(); $node->save(); - $this->logger('content')->notice('book: updated %title.', array('%title' => $node->label(), 'link' => \Drupal::linkGenerator()->generateFromUrl($this->t('View'), $node->urlInfo()))); + $this->logger('content')->notice('book: updated %title.', array('%title' => $node->label(), 'link' => $this->getLinkGenerator()->generateFromUrl($this->t('View'), $node->urlInfo()))); } } } diff --git a/core/modules/content_translation/src/Controller/ContentTranslationController.php b/core/modules/content_translation/src/Controller/ContentTranslationController.php index e4d786e..991d51c 100644 --- a/core/modules/content_translation/src/Controller/ContentTranslationController.php +++ b/core/modules/content_translation/src/Controller/ContentTranslationController.php @@ -125,7 +125,7 @@ public function overview(Request $request, $entity_type_id = NULL) { $link = isset($links->links[$langcode]['url']) ? $links->links[$langcode] : array('url' => $entity->urlInfo()); if (!empty($link['url'])) { $link['url']->setOption('language', $language); - $row_title = \Drupal::linkGenerator()->generateFromUrl($label, $link['url']); + $row_title = $this->getLinkGenerator()->generateFromUrl($label, $link['url']); } if (empty($link['url'])) { diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 5b5cdd9..a3c484f 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -408,7 +408,7 @@ public function save(array $form, FormStateInterface $form_state) { $node = $this->entity; $insert = $node->isNew(); $node->save(); - $node_link = \Drupal::linkGenerator()->generateFromUrl(t('View'), $node->urlInfo()); + $node_link = $this->getLinkGenerator()->generateFromUrl(t('View'), $node->urlInfo()); $context = array('@type' => $node->getType(), '%title' => $node->label(), 'link' => $node_link); $t_args = array('@type' => node_get_type_label($node), '%title' => $node->label()); diff --git a/core/modules/shortcut/src/Form/SetCustomize.php b/core/modules/shortcut/src/Form/SetCustomize.php index 8241cda..89ddf4e 100644 --- a/core/modules/shortcut/src/Form/SetCustomize.php +++ b/core/modules/shortcut/src/Form/SetCustomize.php @@ -52,7 +52,7 @@ public function form(array $form, FormStateInterface $form_state) { foreach ($this->entity->getShortcuts() as $shortcut) { $id = $shortcut->id(); $form['shortcuts']['links'][$id]['#attributes']['class'][] = 'draggable'; - $form['shortcuts']['links'][$id]['name']['#markup'] = \Drupal::linkGenerator()->generateFromUrl($shortcut->getTitle(), $shortcut->getUrl()); + $form['shortcuts']['links'][$id]['name']['#markup'] = $this->getLinkGenerator()->generateFromUrl($shortcut->getTitle(), $shortcut->getUrl()); $form['shortcuts']['links'][$id]['#weight'] = $shortcut->getWeight(); $form['shortcuts']['links'][$id]['weight'] = array( '#type' => 'weight', diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index ea2a96e..39ebb01 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -136,7 +136,7 @@ public function save(array $form, FormStateInterface $form_state) { $result = $term->save(); - $link = \Drupal::linkGenerator()->generateFromUrl($this->t('Edit'), $term->urlInfo('edit-form')); + $link = $this->getLinkGenerator()->generateFromUrl($this->t('Edit'), $term->urlInfo('edit-form')); switch ($result) { case SAVED_NEW: drupal_set_message($this->t('Created new term %term.', array('%term' => $term->getName())));