Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#16011 closed defect (bug) (fixed)

Editing a Network Activated plugin deactivates it

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

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 16 years ago.
16011.2.patch​ (697 bytes ) - added by SergeyBiryukov 16 years ago.
16011.3.patch​ (701 bytes ) - added by SergeyBiryukov 16 years ago.

Download all attachments as: .zip

Change History (14)

#1 @nacin
16 years ago

  • Milestone Awaiting Review → 3.1

#2 @SergeyBiryukov
16 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
16 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
16 years ago

  • Keywords needs-patch added; has-patch removed

#5 @SergeyBiryukov
16 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/plugins.php. Not sure how I've managed to get it activated in both places simultaneously.

Last edited 16 years ago by SergeyBiryukov (previous) (diff)

#6 follow-up: @ryan
16 years ago

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

#7 follow-ups: @nacin
16 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
16 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
16 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
16 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
16 years ago

  • Resolution → fixed
  • Status new → 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.