Make WordPress Core

Opened 11 years ago

Last modified 5 years ago

#24026 new defect (bug)

No /themes/ folder causes strange behaviour

Reported by: slaffik's profile slaFFik Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Themes Keywords: needs-patch
Focuses: Cc:


I know, that it's a tricky behaviour, but the problem exists.

  1. Unzip WordPress files to appropriate place
  2. Go to /wp-content/ and delete /themes/ folder
  3. Install WordPress using it's wizard (ignore error in Dashboard that no theme activated)
  4. Go to Plugins page in admin area
  5. Install BuddyPress (this plugin register the theme BP Default that is situated in plugin folder - this is very important)
  6. Activate BuddyPress and complete its wizard to make BP functional
  7. Go to Themes page in wp-admin
  8. You will now see BP Default Theme. Try to activate it
  9. Ta-da! You've just unlocked a new badge for catching an error.

Change History (6)

#1 @SergeyBiryukov
11 years ago

  • Summary changed from No /themes/ folder couses strange behaviour to No /themes/ folder causes strange behaviour
  • Version changed from 3.5.1 to 3.1

Got "Cheatin' uh?" message from wp-admin/themes.php:

BuddyPress Default theme is correctly registered with /plugins/buddypress/bp-themes as theme root, however wp_get_theme( 'bp-default' ) later looks for WP_CONTENT_DIR . '/themes' instead.

Caused by the early return in get_theme_roots() and get_raw_theme_root():

if ( count($wp_theme_directories) <= 1 )
	return '/themes';

Commenting out these lines in both functions allowed me to activate BuddyPress Default theme.

Introduced in [15641], corrected in [16424]. It assumes that if there's only one theme directory, it's wp-content/themes. According to the ticket description, this assumption isn't always correct, although it's probably an edge case.

Reproduced in 3.1 as well. There was no "Cheatin' uh?" message (it was introduced later in [21010]), however validate_current_theme() still failed, and the theme could not be activated:

#2 @aniketpant
11 years ago

  • Cc me@… added

#3 @nacin
10 years ago

  • Keywords close added

Duplicate of #11282, I think.

#4 @SergeyBiryukov
10 years ago

  • Keywords close removed

Related, but not exactly a duplicate.

#5 @SergeyBiryukov
10 years ago

#28263 was marked as a duplicate.

#6 @chriscct7
9 years ago

  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.