Skip to content

Commit

Permalink
merge r10425 from branch 2.2 to trunk
Browse files Browse the repository at this point in the history
bug 2242 fixed: default theme is changed if upgrade.php deactivated the previous theme.



git-svn-id: http://piwigo.org/svn/trunk@10426 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Apr 16, 2011
1 parent d33d216 commit cb2b12b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion admin/include/functions_upgrade.php
Expand Up @@ -113,7 +113,7 @@ function deactivate_non_standard_plugins()
// Deactivate all non-standard themes
function deactivate_non_standard_themes()
{
global $page;
global $page, $conf;

$standard_themes = array(
'clear',
Expand Down Expand Up @@ -148,6 +148,25 @@ function deactivate_non_standard_themes()

array_push($page['infos'],
l10n('As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:').'<p><i>'.implode(', ', $theme_names).'</i></p>');

// what is the default theme?
$query = '
SELECT theme
FROM '.PREFIX_TABLE.'user_infos
WHERE user_id = '.$conf['default_user_id'].'
;';
list($default_theme) = pwg_db_fetch_row(pwg_query($query));

// if the default theme has just been deactivated, let's set another core theme as default
if (in_array($default_theme, $theme_ids))
{
$query = '
UPDATE '.PREFIX_TABLE.'user_infos
SET theme = \'Sylvia\'
WHERE user_id = '.$conf['default_user_id'].'
;';
pwg_query($query);
}
}
}

Expand Down

0 comments on commit cb2b12b

Please sign in to comment.