I upgraded from 4.6 to 4.7, using a fresh install package of the 4.7 distribution i.e. I didn't add the optional themes and modules I use before updating the DB.
After updating, it was impossible to log in as the administrator as the menus were not visible.
I have add to play with the URL to log as an administrator : I type the adress http://website_adress/?q=user/1 to log as an admin, and then I type the adress http://website_adress/?q=admin/themes
I have there discover the problem : no themes were provided by default ==> no theme were used (which I could also see by the way the page was displayed : no color, ...). I set a theme and then it become OK.

CommentFileSizeAuthor
#5 updates_7.patch462 bytesthierry_gd

Comments

Eglish’s picture

Title: Authentification problem after upgrading » Theme problem after upgrading

If there is no theme, then you see an unstyled page-which still has links on it.

Only case I can think of would be if you're using a 4.6 module to give yourself a menu (and disabled the default one), then when you upgraded you broke the 4.6 module which broke all (only) menu(s).

If the above case is true, I don't think there's very much that can done to fix this.

thierry_gd’s picture

Version: 4.7.0-beta2 » 4.7.0-beta3

The solution would be to set by default the theme "bluemarine" which is part of the drupal package. By the way it is the one which is by default when you do a fresh install.

The update.php should in case of an update :
* check if the theme specified in the DB is one of the one bring with drupal ==> if it not the case set it by default to "bluemarine" else do nothing

The thing is that when, you want to do a clean install you first update drupal and only after yoou install the extra modules and themes.

I will see if I find the way to correct this problem, but I am not familiar with all the source files, so if someone find before me ;)

thierry_gd’s picture

Status: Active » Needs review

Hi, I fixed the problem, and test it : I upgrade from drupal 4.6 to 4.7 beta 3 several times, it work as expected.
Hope, someone will be able to commit it soon to the CVS (I don't have any CVS access) !

To fix that problem, replace in the file updates.inc the code :

//begin code
function system_update_145() {
$default_theme = variable_get('theme_default', 'bluemarine');
$ret = array();
.....
//end code

by the following code :
//Begin code
function system_update_145() {
$default_theme = variable_get('theme_default', 'bluemarine');

$themes = list_themes();
if (!array_key_exists($default_theme, $themes)) {
variable_set('theme_default', 'bluemarine');
$default_theme = 'bluemarine';
}

$ret = array();
.....
//End code

This patch code, will check if your default_theme written in the DB exist in the filesystem, if not then it will set default_theme to "bluemarine" which come by default with drupal.

It work perfectly : you can now to a blank upgrade and after finishing upgrading the core you can add one by one your optionnal modules and themes.

dries’s picture

Status: Needs review » Active

Please provide a real patch. Thanks!

thierry_gd’s picture

Assigned: Unassigned » thierry_gd
Status: Active » Reviewed & tested by the community
StatusFileSize
new462 bytes

Patch created and tested
Update the file updates.inc in the directory database.

thierry_gd’s picture

Assigned: thierry_gd » Unassigned
dries’s picture

In updates.inc there is an update:

function system_update_156() {
  $ret = array();
  $ret[] = update_sql("DELETE FROM {cache}");
  system_themes();
  return $ret;
}

I think it no longer works as intended. I don't quite understand what it does, or why it is supposed to be there. It might be related to the problem you observed. Maybe this is where you new code belongs?

chx’s picture

It could be system_theme_data() , it refills the system table with the new formatted theme data.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Going to change the status of this bug so we can ponder about this some more. Hopefully, someone can investigate this some more. Thanks in advance.

thierry_gd’s picture

Status: Needs work » Reviewed & tested by the community

Hi,

I have been checking about the purpose of system_update_156 ==> don't seem to have nothing to do with the problem I observed. The code in that function need to be optimised, it seem to have some dead code in it ! ==> I will look on how to clean it when I find time (some MBA exams in a few days so not much time to do it immediatly), but it don't affect the patch I submitted.

I tested again a few times the patch I submitted ==> works perfectly ==> can be apply !

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)