Closed (won't fix)
Project:
Drupal core
Version:
6.22
Component:
theme system
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2009 at 18:23 UTC
Updated:
17 Jul 2011 at 08:24 UTC
This is more of a support request as I have experienced this twice on Drupal 5 to Drupal 6 upgrades. The issue is that, for some reason the theme system starts to ignore theme layouts such as node-blog.tpl.php. I also have tested using the contemplate.module and tried to implement changes to node layout through that module's interface without success.
Very odd issue and have only seen it on a couple of installations and thought it was worth reporting. I will post more information here as I find it but if anyone has run into this before, do let me know.
Comments
Comment #1
shane birley commentedOkay, so, I have turned off the theme, removed the files and cleared the cache. When I put the theme back on the server (and checked they were correct using vi) I started receiving these error messages. I removed the node.tpl.php file just to test to see the node-blog.tpl.php would load and this is what happened:
and
This error vanishes when I replace node.tpl.php with anything. No matter the formatting of the node.tpl.php file, the theme uses the base format. Still looking.
Comment #2
shane birley commentedIf I remove block.tpl.php or page.tpl.php from the theme directory the same error above occurs for those files. This is also affecting core themes if I mess with them, I get the same errors.
Comment #3
shane birley commentedAfter tinkering with things, I decided that one thing I had not tried was to rename the theme folder. Magically, it worked. Who knew... closing.
Comment #4
shane birley commentedI am re-opening this as I have found another theme (fresh installation of Drupal 6 and fresh brand new basic theme) that is ignoring files such as:
node-[type].tpl.php
The files are not loading in favour of the default node.tpl.php format. I had encountered this earlier and thought it was just a weird behaviour that I had caused, but this time with a new Drupal installation and a from-scratch theme (that has been working for a few weeks just fine) has started to display the same issue.
I have cleared the theme cache (registry) and even dumped the entire theme in order to see where the issue is coming from.
Comment #5
ainigma32 commentedTry having both the normal node.tpl.php and the node-[type].tpl.php in the theme's folder.
Please post back how that works out for you.
- Arie
Comment #6
shane birley commentedI created a new node.tpl.php with the default with the default layout (from http://api.drupal.org/api/file/modules/node/node.tpl.php/6/source) and posted it into my test theme, cleared the caches, and the problem appears to vanish.
This is similar to my first encounter (without the errors, however). So, it would seem the theme engine is not loading the defaults from the engine itself (which I recall is supposed to happen and appears to happen for a while) and then at some point decides to only load the defaults and ignore any theme generated content.
Comment #7
ainigma32 commentedGood to hear the errors went away. I'm not sure what's happening on your end but you might be able to figure it out by using the Devel module.
I can recommend it especially if you are developing your own theme.
I'm setting this to fixed for now, feel free to change that if you think that is wrong.
- Arie
Comment #8
shane birley commentedI think there is still a bug somewhere but until I determine if it is within Drupal core or on our server (although, the problem doesn't appear at all in our Drupal 5 installations) I agree that it should be set to "fixed". I will gather up any additional information I can - but, for now, having templates in the theme directory isn't a bad work around. If you can think of anything, do let me know.
I did go through the last couple of days of the server error logs and there is nothing to indicate that PHP is tanking or having any problems. I have run out of places to look!
Comment #9
jakew commentedBack to active because I'm having this problem too...
In this case, it's working fine on my local working copy (using MAMP on Mac OS X). Uploading it to my host causes it to start ignoring node-[type].tpl.php ... even with a fresh upload (re-tar the directory for the local copy, upload it, expand it on the server, export the database from local and import it on the server).
I don't know what would possibly be different on the server versus localhost, but apparently there's something...
Comment #10
jakew commentedWow, it was a capitalization issue.
Renaming node-Event.tpl.php to node-event.tpl.php fixed it.
Comment #11
ainigma32 commentedOk back to fixed re #8
- Arie
Comment #12
shane birley commentedI think there is a relationship here with the template suggestions methods but I can't see where.
Comment #14
shane birley commentedComment #15
clemens.tolboomSee also #314543: theme system doesn't load node-nodetype.tpl.php in themedir and #314551: template.php not running phptemplate_preprocess_node (especially #3)
Comment #16
xurizaemonThe reports above appear to agree with the behaviour as documented on Themeing Nodes by Content Type in the handbook. That document says,
If you are experiencing this issue, please verify that you have both a node-TYPE.tpl.php *and* the default node.tpl.php in your theme folder.
Marking this closed, feel free to re-open if you are experiencing this bug and the documented fix (also mentioned by ainigma32 in the comments above) does not resolve the issue.
Comment #17
tran_tien commentedI have both file node.tpl.php and node-type.tpl.php in themes folder, rebuild theme registry but still not work.
Comment #18
damien tournoud commentedI'm sorry, but we don't handle support requests in the Drupal Core issue
queue as a regular practice. There are several support options listed if
you click on "Community and Support" at the top of Drupal.org, which
will take you to: http://drupal.org/community.
There you can find out about the Drupal IRC channels, and the Forums,
which are our two main support mechanisms in the Drupal community.
Good luck with your issue!