Opened 2 years ago
Closed 2 years ago
#57952 closed defect (bug) (fixed)
Able to delete multiple users with the Change button - STRANGE
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | major | Version: | |
Component: | Users | Keywords: | has-patch has-testing-info commit |
Focuses: | administration | Cc: |
Description
While deleting multiple users, I faced this strange behavior. I was able to delete multiple users using the Change button instead Apply
Steps to recreate this issue.
- Navigate to the Users screen.
- Select 2-3 Users.
- Change Bulk actions dropdown to Delete.
- Click Change button instead Apply.
- WordPress will ask you to confirm deleting those users.
Video: https://www.awesomescreenshot.com/video/15740825?key=2abd8945655f6f2c558e56650eb9fa8a
Attachments (2)
Change History (10)
#1
@
2 years ago
- Keywords has-patch needs-testing has-testing-info added; needs-patch removed
- Milestone changed from Awaiting Review to 6.3
Testing Instructions
These steps define how to reproduce the issue, and indicate the expected behavior.
Steps to Reproduce
- Navigate to
Users > All Users
. - Ensure there are at least two users.
- Check the box beside one of the users (not admin).
- In
Bulk actions
, selectDelete
. Do not click Apply - In
Change role to
, Do not select a role - Click
Change
. - 🐞 Bug occurs.
Expected Results
When reproducing a bug:
- ❌ The user is deleted (or the delete confirmation screen appears).
When testing a patch to validate it works as expected:
- ✅ You should see "Sorry, you are not allowed to give users that role."
#2
@
2 years ago
Reproduction Report
This report validates that the issue can be reproduced.
Environment
- WordPress: 6.3-alpha-55505
- PHP: 7.4.33
- Server: Apache/2.4.56 (Ubuntu)
- Database: mysqli (Server: 5.7.41-0ubuntu0.18.04.1 / Client: mysqlnd 7.4.33)
- Browser: Chrome 111.0.0.0 (Windows 10/11)
- Theme: Twenty Twenty-Three 1.1
- MU-Plugins: None activated
- Plugins: None activated
Actual Results
- ❌ The user is deleted (or the delete confirmation screen appears). Issue reproduced.
#3
@
2 years ago
57962.diff forces the action to promote
when $_REQUEST['changeit']
is set.
#4
@
2 years ago
Thanks for the patch!
It looks like there is already some logic in WP_Users_List_Table::current_action()
to set the action to promote
if $_REQUEST['changeit']
is set.
The reason it doesn't work in this case is because it also checks that $_REQUEST['new_role']
is not empty, which is not the case if we did not select a role.
So I think a better solution would be to adjust that logic instead of duplicating it elsewhere, see 57952.2.diff.
#5
@
2 years ago
Test Report ✅
Env
- WordPress - 6.3-alpha-55615
- Chrome Version - Version 111.0.5563.110
- OS - macOS Monterey V12.3.1
- Theme: Storefront Version: 4.2.0
- PHP - 7.4.0
- Web Server - Apache
- Database - MySQL 5.7.28
Steps to test
- Access the WordPress Dashboard.
- Navigate to the 'Users' section.
- Select 2-3 Users.
- Change the Bulk actions dropdown to Delete.
- Click the Change button instead Apply.
Test result
The Change button functionality has been fixed and is now working as expected. Users are no longer being deleted when the Change button is clicked.
Screencast:
Before Fix -
https://screencast-o-matic.com/watch/c0fV6zVaryp
After Fix-
Actual Results
✅ Expected result- works as expected with the patch https://core.trac.wordpress.org/attachment/ticket/57952/57952.2.diff
Force action to
promote
when$_REQUEST['changeit']
is set.