WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 5 months ago

#38112 assigned defect (bug)

Deleting an Active Plugin via Bulk Actions Fails Silently

Reported by: mrwweb Owned by: swissspidy
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Plugins Keywords: needs-testing shiny-updates has-patch
Focuses: Cc:
PR Number:

Description

With the introduction of shinier updates in 4.6, it appears that the error messaging around deleting an activated plugin wasn't ported into the new system properly.

To reproduce:

  1. On Plugins Screen, select an activated plugin.
  2. From "Bulk Actions" select "Delete"
  3. Click Apply

Result:

Nothing happens. Silent failure (to delete).

Expected Result:

Error message explaining that you can't delete activated plugins.

In one case, I actually saw the expected error message after refreshing the plugins page, but I haven't been able to replicate that since.

Attachments (2)

38112.diff (3.4 KB) - added by swissspidy 3 years ago.
38112.2.diff (4.0 KB) - added by swissspidy 3 years ago.

Download all attachments as: .zip

Change History (12)

#1 @swissspidy
3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.7

Thanks for your report. I can confirm the issue.

@swissspidy
3 years ago

#2 @swissspidy
3 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

This really must have slipped under the radar somehow. There was no JS template for bulk deletions or anything. Luckily, it is easy to fix.

38112.diff addresses the issue. @mrwweb Can you test this on your site to see if it works for you as well?

#3 @swissspidy
3 years ago

Here's a screenshot after attempting to delete an inactive and an active plugin:

https://cldup.com/VJG86VzUPL.png

Now I've alse tested on multisite where it doesn't work at all :(

Theme deletion error message is undefined but the theme is deleted anyway after the second attempt:

https://cldup.com/TRb3vAXBgW.png

Plugin deletion error messages work, but somehow there's also an inline error message:

https://cldup.com/LxMbbeZEQG.png

#4 @swissspidy
3 years ago

  • Keywords shiny-updates added
  • Owner set to swissspidy
  • Status changed from new to assigned

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


3 years ago

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


3 years ago

@swissspidy
3 years ago

#7 @swissspidy
3 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 4.7 to Future Release

I couldn't reproduce the undefined bug and I don't know why deleting a network enabled theme is even possible.

38112.2.diff changes the selector in wp.updates.deletePluginError to show the bulk admin notice and the inline notice. This makes the bug at least more obvious for both screens during testing.
Unfortunately, I haven't found a good solution yet to hide inline admin notices during a bulk action. The bulk handler would need to pass custom success & error callbacks instead of hooking into the triggers inside wp.updates.deletePluginError() et al. Ideally, the inline notices should not be added in wp.updates.deletePluginError() directly, but also via the hook.

This ticket was mentioned in Slack in #feature-shinyupdates by swissspidy. View the logs.


3 years ago

#9 @desrosj
7 months ago

  • Keywords has-patch added; needs-patch removed

#10 @SergeyBiryukov
5 months ago

#47337 was marked as a duplicate.

Note: See TracTickets for help on using tickets.