WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#4515 closed defect (bug) (invalid)

What if the Default theme is missing?

Reported by: technosailor Owned by: pishmishy
Priority: normal Milestone:
Component: Template Version: 2.3
Severity: normal Keywords: has-patch needs-testing
Cc: james@…

Description

The expected behavior of WordPRess is that if the theme set in the database becomes unavailable because of deletion or file permissions, the default Kubrick theme is used instead.

The bug exists in that if the default theme also doesn't exist, the site breaks.

My suggestion is that if default is also unavailable that the first theme that IS available is used instead. Only if there are no themes should a site completely die - and even then, well, there could always be a plaintext rendering.

Attachments (1)

theme.php.patch (608 bytes) - added by pishmishy 6 years ago.
Patch to display error message under these conditions.

Download all attachments as: .zip

Change History (9)

comment:1 rob1n6 years ago

As far as my understanding goes, the default theme should *always* be there. Can we rely on another theme having a certain template? I wouldn't really want to.

comment:2 technosailor6 years ago

But what *if* it isn't? ;) I realize some will argue the point that Enterprises are niche, however, in our case we have chosen to remove classic and default for the sake of efficiency. I have to add it back which isn't really that bad all things considered - but, it highlights the problem.

Logic says that yes default will be there 99% of the time but in the off chance that someone does what we have or goes and deltes the theme for their own reasons, do we *really* want WP to break?

I would argue that we don't and we should find a way to make sure that if all else fails, we can programmatically still serve the site.

pishmishy6 years ago

Patch to display error message under these conditions.

comment:3 pishmishy6 years ago

  • Keywords has-patch added

It's not going to be a straight forward task to have WordPress generate even basic output without a theme present on the system. I've created this patch which will tell you why WordPress is broken when the default theme and the selected theme are missing.

comment:4 pishmishy6 years ago

  • Cc james@… added

comment:5 pishmishy6 years ago

  • Owner changed from anonymous to pishmishy
  • Status changed from new to assigned

comment:6 pishmishy5 years ago

  • Keywords needs-testing added

comment:7 ryan5 years ago

  • Resolution set to invalid
  • Status changed from assigned to closed

We no longer revert to the default theme if there is a problem with the current theme.

comment:8 Nazgul5 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.