Opened 13 years ago
Last modified 4 weeks ago
#24026 new defect (bug)
No /themes/ folder causes strange behaviour
| Reported by: | slaFFik | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Themes | Version: | 3.1 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
I know, that it's a tricky behaviour, but the problem exists.
- Unzip WordPress files to appropriate place
- Go to /wp-content/ and delete /themes/ folder
- Install WordPress using it's wizard (ignore error in Dashboard that no theme activated)
- Go to Plugins page in admin area
- Install BuddyPress (this plugin register the theme BP Default that is situated in plugin folder - this is very important)
- Activate BuddyPress and complete its wizard to make BP functional
- Go to Themes page in wp-admin
- You will now see BP Default Theme. Try to activate it
- Ta-da! You've just unlocked a new badge for catching an error.
Change History (8)
#1
@
13 years ago
- Summary No /themes/ folder couses strange behaviour → No /themes/ folder causes strange behaviour
- Version 3.5.1 → 3.1
#7
@
4 weeks ago
Opened [PR #12490](https://github.com/WordPress/wordpress-develop/pull/12490) to address this ticket. When the default themes directory is absent and a plugin registers the only theme directory, get_theme_roots() and get_raw_theme_root() incorrectly fall back to /themes. Limit that shortcut to the actual default theme directory and add regression coverage for a sole non-default root. Testing - npm run test:php -- --filter Tests_Theme_ThemeDir - PHPCBF and PHPCS on the changed files - PHP syntax and git diff checks The PR includes focused regression coverage, and its validation details are recorded in the PR description.
I picked this up because the ticket describes a concrete core behavior or edge case that remains relevant in current WordPress. The proposed change is intentionally scoped to the ticket and is submitted here for code review, with the technical discussion remaining on this ticket.
#8
@
4 weeks ago
Opened [PR #12490](https://github.com/WordPress/wordpress-develop/pull/12490) to address this ticket. When the default themes directory is absent and a plugin registers the only theme directory, get_theme_roots() and get_raw_theme_root() incorrectly fall back to /themes. Limit that shortcut to the actual default theme directory and add regression coverage for a sole non-default root. Testing - npm run test:php -- --filter Tests_Theme_ThemeDir - PHPCBF and PHPCS on the changed files - PHP syntax and git diff checks The PR includes focused regression coverage, and its validation details are recorded in the PR description.
I picked this up because the ticket describes a concrete core behavior or edge case that remains relevant in current WordPress. The proposed change is intentionally scoped to the ticket and is submitted here for code review, with the technical discussion remaining on this ticket.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Got "Cheatin' uh?" message from
wp-admin/themes.php:http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/themes.php#L20
BuddyPress Default theme is correctly registered with
/plugins/buddypress/bp-themesas theme root, howeverwp_get_theme( 'bp-default' )later looks forWP_CONTENT_DIR . '/themes'instead.Caused by the early return in
get_theme_roots()andget_raw_theme_root():http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/theme.php#L285
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/theme.php#L510
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:http://core.trac.wordpress.org/browser/tags/3.1/wp-admin/themes.php#L60