Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#16011 closed defect (bug) (fixed)

Editing a Network Activated plugin deactivates it

Reported by: otto42's profile Otto42 Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Plugins Keywords: has-patch needs-parentheses
Focuses: Cc:

Description

When you go to edit a plugin using the plugin editor, it comes back up as "(active)", however it will actually be deactivated.

Only spotted this with Network Activated plugins.

3.1 RC1.

Attachments (3)

16011.patch (662 bytes) - added by SergeyBiryukov 13 years ago.
16011.2.patch (697 bytes) - added by SergeyBiryukov 13 years ago.
16011.3.patch (701 bytes) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (14)

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.1

#2 @SergeyBiryukov
13 years ago

  • Keywords has-patch added

Was able to reproduce with a plugin which was activated both for Network and specifically on the current site. is_plugin_active() was returning true, so plugin was not reactivated for Network.

I guess we can check is_plugin_active_for_network() too. Patch included.

Or perhaps deactivate_plugins() should always check active_plugins, even if $network_wide.

#3 @nacin
13 years ago

is_plugin_active() checks for is_plugin_active_for_network().

Instead, I imagine the check should probably be based on !empty($_GET['networkwide']). If true, check is_plugin_active_for_network. Otherwise, is_plugin_active.

#4 @nacin
13 years ago

  • Keywords needs-patch added; has-patch removed

#5 @SergeyBiryukov
13 years ago

  • Keywords has-patch added; needs-patch removed

Revised the condition.

BTW, currently when I activate a plugin for Network, it disappears from wp-admin/plugin.php. Not sure how I've managed to get it activated in both places simultaneously.

Version 0, edited 13 years ago by SergeyBiryukov (next)

#6 follow-up: @ryan
13 years ago

Seems fine, but let's add some parens to make the order of operations clear.

#7 follow-ups: @nacin
13 years ago

  • Keywords needs-parentheses added

I imagine you were able to double-activate because it was active on the main site first, then you network activated it. (Network deactivating it will leave it active on the main site, as before.)

#8 in reply to: ↑ 6 @SergeyBiryukov
13 years ago

Replying to ryan:

Seems fine, but let's add some parens to make the order of operations clear.

Done.

#9 in reply to: ↑ 7 @SergeyBiryukov
13 years ago

Replying to nacin:

I imagine you were able to double-activate because it was active on the main site first, then you network activated it. (Network deactivating it will leave it active on the main site, as before.)

When I network activate a plugin, it disappears from the list of active plugins on the main site, so I guess this means it is automatically deactivated there (or should be).

#10 in reply to: ↑ 7 @SergeyBiryukov
13 years ago

Replying to nacin:

(Network deactivating it will leave it active on the main site, as before.)

Missed this comment. It makes sense for me now.

#11 @ryan
13 years ago

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

(In [17183]) Don't deactivate a plugin that is both network activated and activated on the main site after editing. Props SergeyBiryukov. fixes #16011

Note: See TracTickets for help on using tickets.