Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#27067 closed defect (bug) (fixed)

wp-admin/plugin-editor.php dies when no plugins are installed

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by: johnbillion's profile johnbillion
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.0
Component: Plugins Keywords: has-patch commit
Focuses: ui, administration Cc:

Description

When you visit wp-admin/plugin-editor.php without any plugins installed, WP immediately bails with wp_die():

There are no plugins installed on this site.

It should instead:

  1. Present a normal admin page, complete with admin navigation. Or
  2. Not present the menu item to begin with.

Attachments (1)

27067.patch (731 bytes) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
11 years ago

  • Keywords has-patch added
  • Version changed from 3.8.1 to 3.0

Related: #13117

We wouldn't want to call get_plugins() on every admin page load just to hide the menu item, see [14299].

27067.patch turns the wp_die() message into a regular admin page with header and footer.

#2 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.9

#3 @SergeyBiryukov
11 years ago

  • Keywords commit added

#4 @johnbillion
11 years ago

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

In 27506:

Present a normal admin page when bailing out of the Plugin Editor screen. Fixes #27067. Props SergeyBiryukov.

#5 @johnbillion
11 years ago

I replaced the error text in Sergey's patch with the error text used on the regular Plugins listing screen to avoid introducing a new string.

#6 @SergeyBiryukov
11 years ago

The string was not new, but removing it in favor of the one used on the regular Plugins screen makes sense.

Note: See TracTickets for help on using tickets.