If you do a a fresh install and go to "Administer > Site building > Themes" you will see that all themes are disabled including the default one.
It is not a display problem: themes are actually disabled into the database -- status = 0 into system table.

The selection of the default theme is done in system_install(), but it is not enabled :

  db_query("INSERT INTO {variable} (name,value) VALUES('theme_default', 's:7:\"garland\";')");

  db_query("INSERT INTO {blocks} (module,delta,theme,status,pages) VALUES('user', 0, 'garland', 1, '')");
  db_query("INSERT INTO {blocks} (module,delta,theme,status,pages) VALUES('user', 1, 'garland', 1, '')");

IMO the easiest fix would be to add there a line to also enable it:

  db_query("INSERT INTO {variable} (name,value) VALUES('theme_default', 's:7:\"garland\";')");
  db_query("UPDATE {system} SET status = 1 WHERE name = 'garland' AND type = 'theme'");

  db_query("INSERT INTO {blocks} (module,delta,theme,status,pages) VALUES('user', 0, 'garland', 1, '')");
  db_query("INSERT INTO {blocks} (module,delta,theme,status,pages) VALUES('user', 1, 'garland', 1, '')");

As this looks kind of hardcoded, I thought that install profiles could be a good place for default theme selection.
This would allow for greater per-site flexibility, but I am not sure if this is an acceptable solution.
Anyway I have quickly tried to add these lines to default.profile and they work good:

  $default_theme = 'garland';
  db_query("UPDATE {system} SET status = 1 WHERE name = '%s' AND type = 'theme'", $default_theme);
  db_query("UPDATE {blocks} SET theme = '%s'", $default_theme);
  variable_set("theme_default', 's:7:\"$default_theme\";");

Thanks for any comments and opinions.
Riccardo

CommentFileSizeAuthor
#2 patch_140.txt794 byteswebernet

Comments

webernet’s picture

Title: The install script doesn't enable any themes » The installer doesn't enable any themes

I can confirm that a fresh install does not enable any themes, including the default.

webernet’s picture

Status: Active » Needs review
StatusFileSize
new794 bytes

Attached patch enables Garland in system_install().

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

oui.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch, slightly modified, committed. Install profiles can still set their own values as before, since they run after the system install is already done.

Anonymous’s picture

Status: Fixed » Closed (fixed)