Opened 4 years ago
Last modified 4 weeks ago
#57233 new defect (bug)
Send password reset action link not working on multisite
| Reported by: | christopherplus | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Networks and Sites | Version: | 6.1.1 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | multisite |
Description
In a multisite installation while the quick action link "Send password reset" shows up when accessing users list (wp-admin/network/site-users.php), it doesn't send the email neither any admin notice appear when clicked. It simply redirects to the main multisite users screen (wp-admin/network/users.php).
Change History (5)
This ticket was mentioned in PR #12808 on WordPress/wordpress-develop by @sukhendu2002.
5 weeks ago
#3
- Keywords has-patch has-unit-tests added
Trac ticket: https://core.trac.wordpress.org/ticket/57233
#4
@
4 weeks ago
Thanks for the report and the suggested direction. I picked this up because the issue remains reproducible on trunk and also affects the bulk password-reset action on the site-users screen.
PR: https://github.com/WordPress/wordpress-develop/pull/12808
The PR:
- Uses the context-aware
$urlfor the row action. - Adds
resetpasswordhandling and notices tonetwork/site-users.php. - Shares reset processing between the regular and Multisite user screens.
- Handles invalid user IDs without a fatal error.
- Adds focused single-site and Multisite tests for the action URL, email dispatch, reset count, current-user skip, and invalid IDs.
The focused PHPUnit tests pass in both configurations, and all PR checks are currently passing. Review and feedback are welcome.
@mebo commented on PR #12808:
4 weeks ago
#5
Nice fix — pulled the branch and confirmed both the row-action link and the bulk action work correctly now, in single-site and multisite, with the new tests passing in both configs. Also confirmed the err_admin_reset line removed from users.php was already dead code on trunk (it was unconditionally overwritten right after the loop), so that cleanup doesn't change behavior.
One small thing: in the new resetpassword case in network/site-users.php, submitting the bulk action with no users selected silently redirects with no admin notice (this mirrors users.php's existing behavior). But the sibling actions on this same screen — remove and promote — both show a "Select a user to …" notice in that case. Might be worth adding $update = 'err_resetpassword'; + a matching notice for consistency with the rest of the screen. Not blocking, just noticed the asymmetry.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the report! I can confirm this is reproducible.
In
WP_Users_List_Table::handle_row_actions()(class-wp-users-list-table.php), the "Send password reset" link is hardcoded tousers.php?action=resetpassword, unlike the other row actions, which use the context-aware$url(set tosite-users.php?id={site_id}&on multisite). On the network site-users screen, the link therefore points tonetwork/users.php, which has noresetpasswordhandler. Result: no email, no admin notice, just a redirect to the network users list.Possible fix: Build the reset link from
$url(asremovealready does) so it stays onsite-users.php, and add aresetpasswordcase tosite-users.phpmirroring the existing handler inusers.php.