WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19089 closed defect (bug) (fixed)

PHP notice when themes dir. is empty, doesn't exist or the path is wrong

Reported by: azaozz Owned by: ryan
Milestone: 3.3 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch dev-feedback
Focuses: Cc:

Description

On new installs we run quite a bit of code trying to find a theme (so the front-end is not a white screen) but don't show an error if a theme cannot be found. This can happen if WordPress is not installed properly or the path to wp-content/themes is wrong (for example in WP_CONTENT_DIR).

In these cases there's also a notice in get_current_theme().

Attachments (1)

19089.patch (1.6 KB) - added by azaozz 2 years ago.
Fix notice and show a warning on the dashboard when there aren't any themes available

Download all attachments as: .zip

Change History (6)

azaozz2 years ago

Fix notice and show a warning on the dashboard when there aren't any themes available

comment:1 ocean902 years ago

Mhh, in your patch $current_theme = 'Twenty Ten';, need to change it to Twenty Eleven?

comment:2 azaozz2 years ago

That was in there, not sure why. Could probably be empty string as it's set before a theme is found and then overwritten couple of lines down.

comment:4 edwardw2 years ago

  • Keywords has-patch dev-feedback added

comment:5 ryan2 years ago

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

In [19251]:

Avoid notice when themes dir is empty or missing. Don't reset current theme in current_theme_info() if there are no themes. Show warning in Right Now if there are no themes. Props azaozz. fixes #19089

Note: See TracTickets for help on using tickets.