I have a subtheme that I basically copied and modified from zen_fixed. I switched themes to something else earlier today and when I switched back, my subtheme was no longer "working". Nothing else changed, I simply switched themes, switched back, and it doesn't work anymore.
It seems that zen_variables in my template.php is not being called anymore, so none of the core zen css files are being included. Why could this be? What calls zen_variables in the first place and how can I fix it?
Thanks,
jonathan
Comments
Comment #1
johnalbinzen_fixed is not included with 5.x-0.8. What version are you really using?
Comment #2
ilmaestro commentedMy mistake,
Zen 5.x-0.7.
This is probably something that might be hard to reproduce. I'm wondering if anyone has seen this before or might just happens to know what could cause it?
Comment #3
johnalbinIt's going to be impossible to reproduce since no one has seen how you modified the code.
FYI, the latest 5.x-1.0-beta1 is a much better starting point for subtheme creation.
Comment #4
rtivel commentedI think I am encountering the same problem when trying to implement a subtheme in drupal-6.x. See http://drupal.org/node/207441 for some comments on this.
Comment #5
ilmaestro commentedOk, i found part of what is causing the problem. Once I have my theme all up and working, if I browse to the admin/themes page the following SQL is executed:
1.61 1 system_theme_data DELETE FROM system WHERE type = 'theme_engine'
0.42 1 system_theme_data INSERT INTO system (name, type, filename, status, throttle, bootstrap) VALUES ('phptemplate', 'theme_engine', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0)
0.63 1 system_get_files_database SELECT filename, name, type, status, throttle, schema_version FROM system WHERE type = 'theme'
0.89 1 system_theme_data DELETE FROM system WHERE type = 'theme'
0.3 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('chameleon', 'themes/chameleon/chameleon.theme', 'theme', 'themes/chameleon/chameleon.theme', 0, 0, 0)
0.27 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('bluemarine', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'themes/bluemarine/page.tpl.php', 0, 0, 0)
0.3 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('garland', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'themes/garland/page.tpl.php', 1, 0, 0)
0.28 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('pushbutton', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'themes/pushbutton/page.tpl.php', 0, 0, 0)
0.29 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('zen', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'sites/default/themes/zen/page.tpl.php', 1, 0, 0)
0.32 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('mytheme', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'sites/default/themes/zen/mytheme/page.tpl.php', 1, 0, 0)
0.28 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('marvin', 'themes/chameleon/chameleon.theme', 'theme', 'themes/chameleon/marvin/style.css', 0, 0, 0)
0.29 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('minnelli', 'themes/garland/page.tpl.php', 'theme', 'themes/garland/minnelli/style.css', 0, 0, 0)
0.31 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('zen-fixed', 'sites/default/themes/zen/page.tpl.php', 'theme', 'sites/default/themes/zen/zen-fixed/style.css', 1, 0, 0)
After this stuff is executed, my theme ends up being trashed and for whatever reason, zen_variables stops being called. Any comments?
Comment #6
johnalbinThe SQL log you posted is what is supposed to happen. Drupal re-builds the list of available themes everytime you go to admin/build/themes.
The problem that Zen tries to work around is this:
Drupal (by design) thinks that "mytheme" is a separate theme from Zen because mytheme has its own page.tpl.php file. Compare that line to the line for Minnelli (which is a sub-theme of Garland.)
Your sub-theme's template.php should be including the ../template-subtheme.php page which attempts to fix "mytheme" to be labeled a proper sub-theme of Zen (see
path_to_subtheme().)So look at the SQL log after the snippet you pasted above. See anything relavent?
For instance, when using Zen Classic and going to admin/build/themes, my SQL log shows:
0.68 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('zen', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'sites/drupal5x.kanga.albin.net/themes/zen/page.tpl.php', 1, 0, 0)
0.51 1 system_theme_data
INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('zen_classic', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'sites/drupal5x.kanga.albin.net/themes/zen/zen_classic/page.tpl.php', 1, 0, 0)<-- Drupal sets this “incorrectly”0.55 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('marvin', 'themes/chameleon/chameleon.theme', 'theme', 'themes/chameleon/marvin/style.css', 0, 0, 0)
0.82 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('minnelli', 'themes/garland/page.tpl.php', 'theme', 'themes/garland/minnelli/style.css', 0, 0, 0)
0.63 1 system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('SUBTHEME', 'sites/drupal5x.kanga.albin.net/themes/zen/page.tpl.php', 'theme', 'sites/drupal5x.kanga.albin.net/themes/zen/SUBTHEME/style.css', 0, 0, 0)
0.88 2 list_themes SELECT * FROM system WHERE type = 'theme'
1.38 1 _node_types_build SELECT nt.type, nt.* FROM node_type nt ORDER BY nt.type ASC
0.86 1 drupal_get_filename SELECT filename FROM system WHERE name = 'zen' AND type = 'theme'
2.21 1 path_to_subtheme
UPDATE system SET description='sites/drupal5x.kanga.albin.net/themes/zen/page.tpl.php', filename='sites/drupal5x.kanga.albin.net/themes/zen/zen_classic/style.css' WHERE name='zen_classic'<-- Zen fixes the errorComment #7
ilmaestro commentedOk, I can reproduce the bug perfectly. It happens only if I put a page.tpl.php in a subtheme folder and occurs when I browse to the theme/admin page. Even if I use the exact same page.tpl.php that is in the parent zen folder, having that file in my subtheme's folder breaks things as described in the initial post. It even breaks the zen-fixed subtheme.
Note that this is executed when browsing the admin/themes page:
1.61 1 system_theme_data DELETE FROM system WHERE type = 'theme_engine'
system_theme_data INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('socialstylez', 'themes/engines/phptemplate/phptemplate.engine', 'theme', 'sites/default/themes/zen/socialstylez/page.tpl.php', 1, 0, 0)
See if you can reproduce it... just put a page.tpl.php in the zen-fixed subtheme and browse to the theme admin page.
Comment #8
johnalbinI forgot you were using 5.x-0.7. This bug has already been fixed in 5.x-1.0-beta1.
Comment #9
ilmaestro commentedthanks for the info. i'll try to work the new zen beta in when i get a chance.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.