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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | patch_140.txt | 794 bytes | webernet |
Comments
Comment #1
webernet commentedI can confirm that a fresh install does not enable any themes, including the default.
Comment #2
webernet commentedAttached patch enables Garland in system_install().
Comment #3
moshe weitzman commentedoui.
Comment #4
gábor hojtsyThanks 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.
Comment #5
(not verified) commented