﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
22501	class-wp-upgrader.php is using the wrong theme directory	toscho		"There are multiple places in `class-wp-upgrader.php` with a hard coded path to `WP_CONTENT_DIR . '/themes'`. Upgrades will fail if the theme directory is actually in another place.

If there is still a `wp-content/themes` directory, the theme will be installed into that, but the old theme is used and the upgrade nag doesn’t go away.

If there is no such directory the upgrader dies with an error.

In both cases the user is stuck with an outdated theme and no ability to the new one.

Test plugin to reproduce this bug:


{{{
<?php
/* Plugin Name: Local Theme Roots */

add_filter( 'theme_root_uri', 't5_switch_theme_root' );
add_filter( 'theme_root',     't5_switch_theme_root' );

/**
 * Create a custom theme directory.
 *
 * @wp-hook theme_root
 * @wp-hook theme_root_uri
 * @author  Thomas Scholz, http://toscho.de
 * @param   string $in URL or path
 * @return  string
 */
function t5_switch_theme_root( $in )
{
	if ( 'theme_root_uri' === current_filter() )
		return 'http://trunk-themes.wp';

	// If we made it so far we are in the 'theme_root' filter.
	$new_root = 'F:\wp.trunk.themes';
	register_theme_directory( $new_root );
	return $new_root;
}
}}}


The solution is to use `get_theme_root()` instead of a fixed path.

The attached patch does exactly that. Tested on latest Trunk."	defect (bug)	new	normal	3.6	Upgrade/Install	2.9	normal		has-patch	24-7@… tom@…
