Closed (duplicate)
Project:
Drupal core
Version:
10.1.x-dev
Component:
user system
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Feb 2011 at 16:07 UTC
Updated:
7 Dec 2022 at 01:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danillonunes commentedI would like to see this feature too. Sometimes I miss an user/edit path to use in a custom menu.
Comment #2
danillonunes commentedI made a patch against HEAD. I don't know if it is the best way to do it, but it's the simpler that I could do for now.
Maybe someone can improve this (like, if both user/%user/edit and user/edit runs the same "wrapper" function, that checks if the uid has been passed into the url and, if not, redirect to the correct path with the uid appended. It would be more "consistent" IMHO).
Comment #3
sebyoga commentedHello,
If you wan't, temporary, you can use the module "me" when you don't not know a user's account ID.
Example : user/me/edit
Best regards,
Sébastien
Comment #4
kscheirerStill seems useful to me, rerolled patch against HEAD.
Comment #5
sammuell commented#4: user-user_edit-1057570-4.patch queued for re-testing.
Comment #7
sammuell commentedI just implemented this feature in a custom module (for d7) and thought that this is missing in core. After a quick search I found this issue.
My version also includes correct handling for the destination parameter.
Comment #8
sammuell commentedForgot to change issue status...
Comment #9
sushantpasteNeeds to create patch according to Drupal 8 Menu routing system.
Drupal 8 routing
Comment #10
sushantpasteComment #11
nitesh pawar commentedcreated patch according to Drupal 8 Menu routing system.
Comment #16
deg commentedI believe this would be a very useful addition and have client requests for it. Attempting to apply the patch to a dev site returned a rejected hunk at @@ -15,7 +15,7 @@, likely due to additional ‘use Symfony’ includes in the latest version of Drupal. I manually added the rejected hunk and it works wonderfully.
I'm glad this is redirecting to the canonical user/{uid}/edit as far as I can tell. This patch does not, however, redirect other links such as user/{uid}/shortcuts, which might be additional functionality that could be helpful.
Comment #18
MaskOta commentedI like this functionality but i think it should be handled like the '/user' route where we just redirect to the entity.user.canonical with the current user id:
so something like:
Comment #19
artusamakHere is a patch attempt for that following the strategy suggested in #18.
Comment #26
ranjith_kumar_k_u commentedRe-rolled the last patch for 9.3
Comment #27
ranjith_kumar_k_u commentedFixed custom commands fail
Comment #28
mitthukumawat commentedI have applied the patch #27 cleanly but I can still see the dependency on
user idwhile editing the currently logged in user.The path is showing as
user/{userid}/edit. But if I enter the urluser/editmanually, it redirected this again touser/{userid}/edit. I think it should beuser/editwhen edit the currently logged in user.Steps I have followed for testing :
Edittab..
Comment #31
sonam.chaturvedi commentedPatch #27 applied successfully on 9.5.x-dev with 2 offsets.
Test Result:
Same as #28. User is able to access 'user/edit' manually and is redirected to user/{userid}/edit
Comment #33
kristen polThanks for the patches and updates.
@ranjith_kumar_k_u Please include an interdiff when making changes (I see you fixed some typos): https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Since the typos were fixed, I just have some nitpicks and one naming convention thing.
The wrapping isn't quite right but, rather than fixing that, maybe we can just get it down to one line, e.g.
Returns a redirect for the current user's profile edit page.(Note, I checked and "profile page" is used more than "account page" in the code.)
Missing doc block.
Since this is wrapping with one dangling word, consider rewording to make it one line and making it consistent with above changes, e.g.
Verify the redirected route is still the current user's profile edit page.Wording is a bit awkward and "account edition page" is not commonly used, so consider rewording and making it consistent with above changes, e.g.
The current url is the current user's profile edit page.Lastly, I'm not sure about using "shortcut" in the naming since shortcuts are a thing in core. Maybe we call it a redirect? e.g.
user.edit_redirectuserEditRedirectComment #34
pooja saraah commentedComment #35
pooja saraah commentedThanks for your suggestions @Kristen Pol
Addressed the comment #33
Attached patch against Drupal 10.1.x
Attached reroll patch.
Comment #36
pooja saraah commentedComment #37
acbramley commentedSwapped to use the existing redirect callback.
Comment #38
dpiIt looks like another issue duplicating this issue was already merged: #3168624: Add 'user/edit' route
The other was created in 2020 and merged 2 months ago into 9.5.x and 10.x branches.
The new route is available at
user.edit, see also the change record: https://www.drupal.org/node/3313603