Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20497 closed defect (bug) (fixed)

Error Never Goes Away After Deleting an Active Plugin

Reported by: ipstenu's profile Ipstenu Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: major Version: 3.4
Component: Plugins Keywords: has-patch
Focuses: Cc:

Description

I'm on my way out, so apologies for brevity.

Steps to reproduce

1) Activated Hello Dolly on a site on my network.

2) Deleted hello.php

3) Got an error that the plugin was deactivated for being not found, as expected.

4) I went elsewhere, came back to the plugins page... the error was still there.

I don't know if this is because I'm on a network (or if it's something weird with my database, I'd buy that too, since it takes a minute or so before a theme activated per-site shows up ON that site), but since I could reproduce it on my localhost install, I suspect it's not just my DB.

To fix I had to restore hello.php, then deactivate, THEN delete.

That's gonna cause a problem when we tell people to rename the plugins folder to debug.

Attachments (2)

Screen Shot 2012-04-20 at 20 Apr - 5.14.36 PM.png (8.1 KB) - added by Ipstenu 12 years ago.
Error message - sticks around.
20497.patch (673 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (5)

@Ipstenu
12 years ago

Error message - sticks around.

#1 @SergeyBiryukov
12 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.4

Reproduced in a single site configuration as well. Introduced in [20525].

Contrary to the PHPDocs for deactivate_plugins(), if $network_wide is null, the rest of the loop after line 597 will be skipped for site-only activated plugins:
http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/plugin.php?rev=20525#L595

20497.patch is an attempt to correct the logic. Tested in single site admin, regular admin in Multisite, network admin.

#2 @nacin
12 years ago

Nice work. Logic change looks proper.

#3 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [20555]:

Correct logic in deactivate_plugins() where network_wide = null. props SergeyBiryukov. fixes #20497.

Note: See TracTickets for help on using tickets.