Make WordPress Core

Opened 6 months ago

Last modified 5 weeks ago

#62788 new enhancement

Update request for 'Deleting...' string after failed Ajax attempt

Reported by: ignatiusjeroe's profile ignatiusjeroe Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 6.7.1
Component: Plugins Keywords: has-patch has-test-info dev-feedback
Focuses: administration Cc:

Description

please see attached image

Attachments (5)

Screen Shot 2025-01-08 at 17.40.08.png (57.9 KB) - added by ignatiusjeroe 6 months ago.
62788.patch (1.4 KB) - added by vrishabhsk 6 weeks ago.
Patch
before.mov (5.4 MB) - added by vrishabhsk 6 weeks ago.
Before patch - current version
after.mov (4.1 MB) - added by vrishabhsk 6 weeks ago.
After the fix was implemented.
62788-new.patch (1.7 KB) - added by vrishabhsk 6 weeks ago.
Latest Patch with the required changes

Change History (19)

#1 @ignatiusjeroe
6 months ago

BTW, if a second attempt is made by clicking on the 'Deleting...' link, the error message isnt removed. It makes more sense for the script to first remove any error messages prior to sending a new Ajax request. With this rather small feedback mechanism you have the impression that your request was actually registered.

#2 @sainathpoojary
6 months ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Nineteen 3.0
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Actual Results

✅ Error condition occurs (reproduced).

Supplemental Artifacts

Video: https://utfs.io/f/PL8E4NiPUWyOm5BNZZklrLsNmfguwi69VUazeO2chToFXQKn

@vrishabhsk
6 weeks ago

Patch

This ticket was mentioned in PR #8855 on WordPress/wordpress-develop by @vrishabhsk.


6 weeks ago
#3

  • Keywords has-patch added

#4 @vrishabhsk
6 weeks ago

Hi @ignatiusjeroe, I have attached the patch and also raised the PR for the fix. Let me know if it works or needs additional changes. I will be attaching the before and after screencasts as well.

@vrishabhsk
6 weeks ago

Before patch - current version

@vrishabhsk
6 weeks ago

After the fix was implemented.

#5 @SirLouen
6 weeks ago

  • Keywords changes-requested added

Test Report

Description

❌ This report can't validates the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8855.diff

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty 2.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0
    • WP Dummy Content Generator 4.0.0
    • WP Mail SMTP 4.4.0

Testing Instructions

Expected Results

  • Downloading disappear after error.

Actual Results

  1. ❌ Issue not resolved with patch.

Additional Notes

  • @vrishabhsk check the video instructions to see why the patch is not working.

#6 follow-up: @vrishabhsk
6 weeks ago

hi @SirLouen, you have tested for offline condition. The patch is for when the user does not have permission to delete the plugin and the alert is produced : https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/includes/ajax-actions.php#L4736

On line 4736, you can remove the ! for testing purposes and see that the patch will work. Apologies for not mentioning the test scenario. Let me know if im mistaken. Thanks

#7 in reply to: ↑ 6 @SirLouen
6 weeks ago

Replying to vrishabhsk:

hi @SirLouen, you have tested for offline condition. The patch is for when the user does not have permission to delete the plugin and the alert is produced : https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/includes/ajax-actions.php#L4736

On line 4736, you can remove the ! for testing purposes and see that the patch will work. Apologies for not mentioning the test scenario. Let me know if im mistaken. Thanks

Can you try to sort all conditions in one shot?

#8 @vrishabhsk
6 weeks ago

Sure, ill take a look.

@vrishabhsk
6 weeks ago

Latest Patch with the required changes

#9 @vrishabhsk
6 weeks ago

hi @SirLouen. I have attached the latest patch that should resolve the issue for all instances of this bug when the plugin deletion fails

Let me know if you find any issues with this. Thanks

Last edited 6 weeks ago by vrishabhsk (previous) (diff)

#10 @sainathpoojary
6 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/62788/62788-new.patch

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 136.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Actual Results

  1. ✅ Reverting “Deleting” back to “Delete” after a failed AJAX request due to network failure.
  2. ❌ Removing the Deletion failed notice on Successful deletion

Additional Notes

Thanks for updating the patch, @vrishabhsk. I’ve tested it, if removing the notice after a successful deletion is the expected behavior, it looks like the issue still persists. Functionally, everything else is working well.

Supplemental Artifacts

Video: https://rioudcpuyg.ufs.sh/f/PL8E4NiPUWyOwGqVTflBwjlD9K4qhAts3a26Vvd1rSI0xfio

#11 @vrishabhsk
6 weeks ago

Hi @sainathpoojary, Thanks for the confirmation.

  • The Admin notice is dismissible and can cleared manually.
  • The scope of this ticket is to revert the delete button text back to its original text when the deletion operation fails.
  • It should not be stuck at deleting...

#12 @SirLouen
6 weeks ago

@sainathpoojary you should have tried, dismissing the notice before successfully deleting because it appears that the notice was added from the previous error (and you did not dismiss it in the video after the second try, so it persisted)

Can you retry?

#13 @sainathpoojary
5 weeks ago

Thanks for the clarification, @vrishabhsk and @SirLouen.

I’ve retested the patch after manually dismissing the error notice before performing a successful deletion. Everything is now working as expected:

  • ✅ The “Deleting” button text correctly reverts back to “Delete” when a deletion fails.
  • ✅ The “Deletion failed” notice does not persist after a successful deletion when previously dismissed.

Everything looks good now. ✅

#14 @SirLouen
5 weeks ago

  • Keywords has-test-info dev-feedback added; changes-requested removed
Note: See TracTickets for help on using tickets.