Wrong code snippet causing blank screen

I was playing around with my Drupal 5 test site to add some PHP code snippet to Drupal in a block. Not sure what happen but upon saving my code snippet in a block the whole browser went blank and i was not able to do anything after that. No page display or any way to get back into my Drupal test site... yikes!

Above all, stay calm and don't panic. First place to diagnose was to look in the Drupal database since everything Drupal does is saved to the DB. So i fired up phpmyadmin to access my DB tables. First place to look was the table named 'block'. There i found an entry for the block i had created where i put my code snippet into. Browsing the data on that table did not reveal my code snippet, strangely enough. nevertheless, i deleted the entry and went back to the drupal site to see if that had helped. Still a blank white page, don't panic. So went back to the DB to investigate again. After some time trawling thru the DB tables i managed to find the code snippet. It was saved in a table named 'boxes'. Very odd why not in the 'block' table? Whatever, deleting this entry brought my site back to life.

So there you go, i think most of the users that has been using Drupal for quite some time have probably encountered this before as we all make silly mistakes but if you're new i hope this will save you some frustrating time trying to pinpoint the issue.

Trackback URL for this post:

http://duvien.com/trackback/170
from blank on Sun, 08/03/2008 - 05:35

Bookmarked your post over at Blog Bookmarker.com!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks everyone, these are

Thanks everyone, these are excellent tips.

You can also find helpful

You can also find helpful information about the white screen in the PHP error log.

Heed the warnings

The drupal.org snippet handbook pages are loaded with warnings about how you should go through the code yourself and that you should test them before actually implementing them.

If you're going to test a snippet, put them in a story node for instance and hit "preview". Doing so always you to test the snippet without actually putting it in the database.

Another way to fix a broken

Another way to fix a broken block is to click the browser back button after it breaks and you'll be able to edit the code again.