Replace all calls to url() with the new route based URL generation methods Url::fromRoute() and Url::fromUri().

For this issue it is not yet necessary to convert all page callbacks to routes. This will be done in a follow-up.

Change record: l() and url() are removed in favor of a routing based URL generation API.

Comments

ieguskiza’s picture

Assigned: Unassigned » ieguskiza
ieguskiza’s picture

Assigned: ieguskiza » Unassigned
Status: Active » Needs review
Issue tags: -Novice +Novice d8sandwichSessions
StatusFileSize
new3.17 KB

Removed url() functions

pfrenssen’s picture

Issue tags: -Novice d8sandwichSessions +Novice, +d8sandwichSessions
kalinchernev’s picture

Assigned: Unassigned » kalinchernev
kalinchernev’s picture

imanol.eguskiza changes seem good.

+++ b/scheduler.admin.inc
@@ -263,11 +263,11 @@ function theme_scheduler_timecheck($variables) {
-    '@user_account' => url('user/' . $user->uid . '/edit'),

$user object has been replaced by $account, I just noticed that after pulling latest changes. A small re-roll will be needed.

kalinchernev’s picture

Assigned: kalinchernev » Unassigned
kalinchernev’s picture

Status: Needs review » Needs work
zealfire’s picture

Status: Needs work » Needs review
StatusFileSize
new3.34 KB

Made the changes in the latest version.Please review.
Thanks.

kalinchernev’s picture

  1. +++ b/scheduler.admin.inc
    @@ -261,11 +262,11 @@ function theme_scheduler_timecheck($variables) {
    +    '@user_account' => Url::fromRoute('entity.user.edit_form', array('user' => $account->uid)),
    

    This seems to match the routing correctly now.

  2. +++ b/scheduler.module
    @@ -136,7 +137,7 @@ function scheduler_help($section) {
    +      $output = '<p>' . t('Some Scheduler options are set for each different content type, and are accessed via the <a href="@link">admin content type</a> list.', array('@link' => Url::fromRoute('entity.node_type.collection'))) . '</br>';
    

    the "admin/structure/types" page is actually at "node.overview_types"
    At least at current 8.0.0-beta6

pfrenssen’s picture

Status: Needs review » Needs work
+++ b/scheduler.admin.inc
@@ -261,11 +262,11 @@ function theme_scheduler_timecheck($variables) {
-    '@user_account' => url('user/' . $account->id() . '/edit'),
+    '@user_account' => Url::fromRoute('entity.user.edit_form', array('user' => $account->uid)),

I would keep the original call to $account->id() instead of accessing the $account->uid property directly.

zealfire’s picture

Status: Needs work » Needs review
StatusFileSize
new3.37 KB

Submitting a new patch taking into account comment 9 and 10.Please review.
Thanks.

pfrenssen’s picture

Status: Needs review » Needs work
+++ b/scheduler.admin.inc
@@ -261,11 +262,11 @@ function theme_scheduler_timecheck($variables) {
-    '@user_account' => url('user/' . $account->id() . '/edit'),
+    '@user_account' => Url::fromRoute('entity.node.overview_types', array('user' => $account->id)),

This is now pointing to the node type overview page instead of the user edit form.

pfrenssen’s picture

+++ b/scheduler.admin.inc
@@ -261,11 +262,11 @@ function theme_scheduler_timecheck($variables) {
-    '@user_account' => url('user/' . $account->id() . '/edit'),
+    '@user_account' => Url::fromRoute('entity.node.overview_types', array('user' => $account->id)),

Also just noticed that this is doing $account->id instead of $account->id().

pfrenssen’s picture

Status: Needs work » Needs review
StatusFileSize
new3.37 KB
new910 bytes

Fixed my remarks from #12 and #13.

pfrenssen’s picture

All seems good, merged into 8.x-1.x, thanks everyone!

pfrenssen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.