While testing the Content Template module version 5.x-2.02 I tried entering the following for Body Template code:

print $body; system('touch /var/www/html/drupal/sites/foo.txt');

And doing so crashed the entire site. Any page that displays the body of content associated with the Content Template displays only a blank page. No watchdog() is implemented to create any logs so there is very little evidence as to the cause of the problem.

Comments

jrglasgow’s picture

Check your apache error logs, the reason for the crash will be in the logs. When you get the "White Screen of Death" (WSOD) it means there was a fatal PHP error.

sohopub’s picture

How does one recover from that? I'm having the same problem and can't access the admin areas to correct the line of code.

Anonymous’s picture

You need to acces the template directly in the Database Table. probably using phpMyAdmin

Remember always make a copy of your template before editing. That way if something does go wrong or if you need to go to the table you can quickly cut and paste to get you back where you was.

I have also tended to keep two windows open with the template in edit mode. So if one goes wrong i click submit on the other to effectivly get me back

sohopub’s picture

Thanks, My DB is about 49MB and I can't seem to open it in any text editors. they seem to hang up. Any suggestions?

Anonymous’s picture

I am guessing your trying to access a backup as you talk about text editors?

You need to go directly into the database that you are running the site from probably using phpMyAdmin

the table you need is

contemplate

Just look for the row that is for the content type that you were editing

either substitute the body field with the correct information or replace with

<?php print $body ?>

To at least allow you to get to the drupal interface

daleeman’s picture

Version: 5.x-2.02 » 6.x-1.1

This is an old issue that I'm bumping here, but it seems odd that the contemplate admin pages would ever need to evaluate the content of the body/teasers of a template. In a quick look at the code I couldn't see where that was being done, but I would think it should just be handled as text.

Is that not correct?

dgtlmoon’s picture

Status: Active » Closed (works as designed)

Unfortunately it is just the nature of the beast.

It's the same as when you are using the PHP input format for node or block edits and you pass some bad code in your page, you will get the white-screen-o-death in other parts of Drupal when not using the contemplate module