only in patch2: unchanged: --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -41,7 +41,7 @@ function block_help($route_name, RouteMatchInterface $route_match) { $demo_theme = $route_match->getParameter('theme') ?: \Drupal::config('system.theme')->get('default'); $themes = list_themes(); $output = '

' . t('This page provides a drag-and-drop interface for adding a block to a region, and for controlling the order of blocks within regions. To add a block to a region, or to configure its specific title and visibility settings, click the block title under Place blocks. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '

'; - $output .= '

' . l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '

'; + $output .= '

' . Drupal::l(t('Demonstrate block regions (!theme)', array('!theme' => $themes[$demo_theme]->info['name'])), 'block.admin_demo', array('theme' => $demo_theme)) . '

'; return $output; } } only in patch2: unchanged: --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -727,8 +727,8 @@ function template_preprocess_comment(&$variables) { $variables['signature'] = ''; } if (isset($comment->in_preview)) { - $variables['title'] = l($comment->getSubject(), ''); - $variables['permalink'] = l(t('Permalink'), ''); + $variables['title'] = Drupal::l($comment->getSubject(), ''); + $variables['permalink'] = Drupal::l(t('Permalink'), ''); } else { $uri = $comment->urlInfo(); only in patch2: unchanged: --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -370,7 +370,7 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->setValue('cid', $comment->id()); // Add a log entry. - $logger->notice('Comment posted: %subject.', array('%subject' => $comment->getSubject(), 'link' => l(t('View'), 'comment/' . $comment->id(), array('fragment' => 'comment-' . $comment->id())))); + $logger->notice('Comment posted: %subject.', array('%subject' => $comment->getSubject(), 'link' => Drupal::l(t('View'), 'entity.comment.canonical', array('comment' => $comment->id()), array('fragment' => 'comment-' . $comment->id())))); // Explain the approval queue if necessary. if (!$comment->isPublished()) { only in patch2: unchanged: --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -86,7 +86,7 @@ function field_help($route_name, RouteMatchInterface $route_match) { if (isset($info[$provider]['name'])) { $display = $info[$provider]['name']; if (\Drupal::moduleHandler()->implementsHook($provider, 'help')) { - $items[] = l($display, 'admin/help/' . $provider); + $items[] = Drupal::l($display, 'help.page', array('name' => $provider)); } else { $items[] = $display; only in patch2: unchanged: --- a/core/modules/filter/src/Element/TextFormat.php +++ b/core/modules/filter/src/Element/TextFormat.php @@ -179,7 +179,7 @@ public static function processFormat(&$element, FormStateInterface $form_state, $element['format']['help'] = array( '#type' => 'container', '#attributes' => array('class' => array('filter-help')), - '#markup' => l(t('About text formats'), 'filter/tips', array('attributes' => array('target' => '_blank'))), + '#markup' => Drupal::l(t('About text formats'), 'filter.tips_all', array(), array('attributes' => array('target' => '_blank'))), '#weight' => 0, ); only in patch2: unchanged: --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -132,7 +132,7 @@ public function form(array $form, FormStateInterface $form_state) { if (!$pass_reset) { $protected_values['mail'] = $form['account']['mail']['#title']; $protected_values['pass'] = $this->t('Password'); - $request_new = l($this->t('Request new password'), 'user/password', array('attributes' => array('title' => $this->t('Request new password via email.')))); + $request_new = Drupal::l($this->t('Request new password'), 'user.pass', array(), array('attributes' => array('title' => $this->t('Request new password via email.')))); $current_pass_description = $this->t('Required if you want to change the %mail or %pass below. !request_new.', array('%mail' => $protected_values['mail'], '%pass' => $protected_values['pass'], '!request_new' => $request_new)); } only in patch2: unchanged: --- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php +++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php @@ -44,14 +44,14 @@ public function build() { // Build action links. $items = array(); if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { - $items['create_account'] = l(t('Create new account'), 'user/register', array( + $items['create_account'] = Drupal::l(t('Create new account'), 'user.register', array(), array( 'attributes' => array( 'title' => t('Create a new user account.'), 'class' => array('create-account-link'), ), )); } - $items['request_password'] = l(t('Request new password'), 'user/password', array( + $items['request_password'] = Drupal::l(t('Request new password'), 'user.pass', array(), array( 'attributes' => array( 'title' => t('Request new password via email.'), 'class' => array('request-password-link'), only in patch2: unchanged: --- a/core/modules/user/src/RegisterForm.php +++ b/core/modules/user/src/RegisterForm.php @@ -115,7 +115,7 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->set('user', $account); $form_state->setValue('uid', $account->id()); - $this->logger('user')->notice('New user: %name %email.', array('%name' => $form_state->getValue('name'), '%email' => '<' . $form_state->getValue('mail') . '>', 'type' => l($this->t('Edit'), 'user/' . $account->id() . '/edit'))); + $this->logger('user')->notice('New user: %name %email.', array('%name' => $form_state->getValue('name'), '%email' => '<' . $form_state->getValue('mail') . '>', 'type' => Drupal::l($this->t('Edit'), 'entity.user.edit_form', array('user' => $account->id())))); // Add plain text password into user account to generate mail tokens. $account->password = $pass; only in patch2: unchanged: --- a/core/modules/user/src/Tests/UserAdminTest.php +++ b/core/modules/user/src/Tests/UserAdminTest.php @@ -52,7 +52,7 @@ function testUserAdmin() { $this->assertText($admin_user->getUsername(), 'Found Admin user on admin users page'); // Test for existence of edit link in table. - $link = l(t('Edit'), "user/" . $user_a->id() . "/edit", array('query' => array('destination' => 'admin/people'))); + $link = Drupal::l(t('Edit'), 'entity.user.edit_form', array('user' => $user_a->id()), array('query' => array('destination' => 'admin/people'))); $this->assertRaw($link, 'Found user A edit link on admin users page'); // Test exposed filter elements. only in patch2: unchanged: --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -1062,7 +1062,13 @@ public function getFormBucket(ViewUI $view, $type, $display) { if ($handler->broken()) { $build['fields'][$id]['#class'][] = 'broken'; $field_name = $handler->adminLabel(); - $build['fields'][$id]['#link'] = l($field_name, "admin/structure/views/nojs/handler/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-ajax-link')), 'html' => TRUE)); + $build['fields'][$id]['#link'] = Drupal::l($field_name, 'views_ui.form_handler', array( + 'js' => 'nojs', + 'view' => $view->id(), + 'display_id' => $display['id'], + 'type' => $type, + 'id' => $id, + ), array('attributes' => array('class' => array('views-ajax-link')), 'html' => TRUE)); continue; } @@ -1079,15 +1085,33 @@ public function getFormBucket(ViewUI $view, $type, $display) { // Add a [hidden] marker, if the field is excluded. $link_text .= ' [' . $this->t('hidden') . ']'; } - $build['fields'][$id]['#link'] = l($link_text, "admin/structure/views/nojs/handler/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => $link_attributes, 'html' => TRUE)); + $build['fields'][$id]['#link'] = Drupal::l($link_text, 'views_ui.form_handler', array( + 'js' => 'nojs', + 'view' => $view->id(), + 'display_id' => $display['id'], + 'type' => $type, + 'id' => $id, + ), array('attributes' => $link_attributes, 'html' => TRUE)); $build['fields'][$id]['#class'][] = drupal_clean_css_identifier($display['id']. '-' . $type . '-' . $id); if ($executable->display_handler->useGroupBy() && $handler->usesGroupBy()) { - $build['fields'][$id]['#settings_links'][] = l('' . $this->t('Aggregation settings') . '', "admin/structure/views/nojs/handler-group/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => $this->t('Aggregation settings')), 'html' => TRUE)); + $build['fields'][$id]['#settings_links'][] = Drupal::l('' . $this->t('Aggregation settings') . '', 'views_ui.form_handler_group', array( + 'js' => 'nojs', + 'view' => $view->id(), + 'display_id' => $display['id'], + 'type' => $type, + 'id' => $id, + ), array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => $this->t('Aggregation settings')), 'html' => TRUE)); } if ($handler->hasExtraOptions()) { - $build['fields'][$id]['#settings_links'][] = l('' . $this->t('Settings') . '', "admin/structure/views/nojs/handler-extra/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => $this->t('Settings')), 'html' => TRUE)); + $build['fields'][$id]['#settings_links'][] = Drupal::l('' . $this->t('Settings') . '', 'views_ui.form_handler_extra', array( + 'js' => 'nojs', + 'view' => $view->id(), + 'display_id' => $display['id'], + 'type' => $type, + 'id' => $id, + ), array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => $this->t('Settings')), 'html' => TRUE)); } if ($grouping) {