WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#37664 closed defect (bug) (duplicate)

Editing plugin isn't selected in the dropdown menu

Reported by: wzislam Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Plugins Keywords: has-patch needs-testing
Focuses: ui, administration Cc:

Description

  • Start editing a plugin in plugin editor (Plugins > Editor)
  • Choose the plugin from the dropdown menu on the right (i.e. Theme Check)
  • Click on any file other than the root plugin file (i.e. theme-check/readme.txt)
  • You will see the dropdown to change back to Akismet (or the first plugin alphabetically)

Note, there's a word saying (inactive) when you touch other file than the root plugin file. And I've seen the thing happens when the inactive appears.

My guess is that, somehow only the root plugin file is detected active, so any other file of that plugin are considered inactive, so the dropdown can't stay active to the active plugin that is on the editor.

Attachments (3)

37664.patch (429 bytes) - added by Clorith 4 years ago.
37664.2.patch (1.4 KB) - added by Clorith 4 years ago.
Account for $file not overriding the plugin anymore when creating URLs in the edit page
Screenshot_2.png (49.3 KB) - added by wzislam 4 years ago.
Plugin is active but showing inactive

Download all attachments as: .zip

Change History (8)

@Clorith
4 years ago

@Clorith
4 years ago

Account for $file not overriding the plugin anymore when creating URLs in the edit page

#1 @Clorith
4 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 4.5.3 to 2.8

The "inactive" bit is added if the plugin isn't enabled on your site (this is incorrectly reported when using anything but the primary file for the same reason the drop down is incorrect).

The drop down relies on recognizing the plugin it belongs to, but we don't actually have a fixed query arg to identify the active plugin by (we change these depending on what file is viewed and the order in which you click on them.

We are currently incorrectly overwriting the plugin query arg with the file (introduced in r11500)

Attached patch, 37664.2.patch, removes the conditional, and ensures we don't accidentally pass over the remaining $plugin variable check by at some point (as it's not explicitly declared in the actual file before this point).

It also updates the URLs used throughout the page to include plugin=$plugin since we no longer override this variable with the current filename at the start of the file.

Will probably need some more testing, but so far not noticed any incorrect behavior.

#2 @wzislam
4 years ago

The "inactive" bit is added if the plugin isn't enabled on your site (this is incorrectly reported when using anything but the primary file for the same reason the drop down is incorrect).

I second that. Attached a screenshot that the plugin is active but showing inactive on the top, and the dropdown is not selected.

@wzislam
4 years ago

Plugin is active but showing inactive

#3 @MattyRob
4 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

This ticket is a duplicate:

https://core.trac.wordpress.org/ticket/24122
https://core.trac.wordpress.org/ticket/17552

Perhaps you could refresh those tickets by adding your patch there.

#4 @MattyRob
4 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Apologies - ticket closed in error.

Need core dev review for closure.

#5 @SergeyBiryukov
4 years ago

  • Focuses accessibility removed
  • Keywords close removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed

Duplicate of #17552 and #24122.

Note: See TracTickets for help on using tickets.