Make WordPress Core

#57164 closed defect (bug) (fixed)

Email change confirmation link incorrect for MU user with no roles

Reported by: roytanck's profile roytanck Owned by: audrasjb's profile audrasjb
Milestone: 6.2 Priority: normal
Severity: normal Version: 4.9
Component: Users Keywords: has-patch commit
Focuses: administration, multisite Cc:

Description (last modified by johnbillion)

The link in an email change confirmation email for users with no roles in a multisite install is incorrect, causing them to be unable to change their email address.

This appears to be a regression. The same issue was fixed in [38876] , but [41163] appears to have undone that fix.

Steps to reproduce:

  • Create a new (subdirectory) multisite install.
  • In the network admin, create a new user.
  • Do not assign any roles to this user.
  • Login as the new user, and attempt to change their email address.
  • When clicking the link in the confirmation email, an error will appear.

As described in #38451, adding /user in the URL will fix the issue. It appears that self_admin_url() does this.

Attachments (1)

57164.diff (835 bytes) - added by roytanck 22 months ago.
Use self_admin_url instead of admin_url when constructing the email confirmation URL.

Download all attachments as: .zip

Change History (12)

#1 @johnbillion
22 months ago

  • Component changed from General to Users
  • Description modified (diff)
  • Keywords needs-patch added
  • Version set to 4.9

Thanks for the report

#2 @SergeyBiryukov
22 months ago

  • Milestone changed from Awaiting Review to 6.2

hi there, thanks for the ticket!

Indeed, it looks like [41163] accidentally reverted both [38876] and a part of [40632], however the latter was fixed in [41165], so self_admin_url() is the only thing to restore here.

@roytanck
22 months ago

Use self_admin_url instead of admin_url when constructing the email confirmation URL.

#3 @roytanck
22 months ago

  • Keywords has-patch added; needs-patch removed

Added a patch that simply replaces admin_url with self_admin_url to restore the previous fix. This fixes the issue for me, but some regression testing is probably warranted.

#4 @afrin29
20 months ago

While trying to reproduce the issue;
unable to create a new multi-site user.
SS:https://d.pr/i/G3Jkqk

Last edited 20 months ago by afrin29 (previous) (diff)

This ticket was mentioned in Slack in #core by costdev. View the logs.


19 months ago

#6 @johnbillion
19 months ago

  • Owner set to johnbillion
  • Status changed from new to reviewing

#7 @johnbillion
19 months ago

  • Keywords commit added

57164.diff fixes the issue as expected, but this is temporarily blocked by #38460 (the bug noted by @afrin29 above) which should be fixed first.

#8 @audrasjb
19 months ago

This is no longer blocked by #38460, fixed in [55394].

This ticket was mentioned in Slack in #core by costdev. View the logs.


19 months ago

#10 @audrasjb
19 months ago

  • Owner changed from johnbillion to audrasjb
  • Status changed from reviewing to accepted

Self assigning for commit as John is AFK at the moment

#11 @audrasjb
19 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 55396:

Users: Fix confirmation link for multisite users with no role.

This fixes a regression introduced in [41163], where the link in change confirmation emails for users with no roles in a multisite install was incorrect, causing them to be unable to change their email address. This changeset replaces admin_url() with self_admin_url() to restore the previous fix.

Follow-up to [38876], [40632], [41165], [41163].

Props roytanck, SergeyBiryukov, johnbillion, afrin29.
Fixes #57164.

Note: See TracTickets for help on using tickets.