I was trying to get my countdown timer working and messed things up badly. Now when i goto my site, there is no site, rather the following message:

Fatal error: Call to undefined function: drupal_add_is() in
/home/a3321686/public_html/includes/common.inc(1342) : eval()'d code on line 2

I had created a block, added the following code:

drupal_add_is('countdowntimer/timerjs');

home opener...
2007-9-6

I then clicked on >Input Format and clicked PHP and now am unable to get back to my site. I'm a newb, is there anyone out there that can help me?

Comments

nancydru’s picture

stormdodger’s picture

drats, how do i get back to the site in order to make the needed change? Thanks!

vm’s picture

you have to manually go into the database and set the block to 0 which will turn it off.

In future when working with and testing blocks using php code, do so on a page or a story, rather then working and testing within blocks. A page or a story wont bring your site to a halt, once you get the code working you can than easily and without fear create the block.

lionheart8’s picture

Whenever I have got some problems involving the site being disabled in some form and I know the "culprit module", I simply use an ftp client to delete it. At least that enables me to access the site again. ... but, there are apparently less "destructive" ways of dealing solving the problem. ;)

vm’s picture

His problem isnt a module , he can remove the module , but because he created a block with incorrect PHP code, deleting the module won't do any good as the he created will still be there.

lionheart8’s picture

Ok, thanks for the correction. :)

MacRonin’s picture

You might want to also try the IRC channel #drupal-support

It looks like since you inserted some bad PHP code your pages can't load. Normally PHP code should be tested first by inserting it in a single page instead of a block so that only that page goes bad. If your block is setup to not display on the admin pages you can go directly to the admin page for controlling blocks and disable. But if its being displayed globally(more likely) than you will have to disable it by modifying the database entry for that block. You would probably use phpMyAdmin to do that. Sorry but I don't know the database layout well enough to advise you on that. But it does give you a specific question to ask on the IRC channel. "How do I disable a block with bad PHP code in it?"

Good luck

Edit: sorry for the repetitive reply But for some reason when I loaded this page I didn't see the other responses.
-------------------
http://www.PrivacyDigest.com/ News from the Privacy Front
http://www.SunflowerChildren.org/ Helping children around the world

stormdodger’s picture

THANK YOU ALL VERY MUCH!!!! I was able to locate the block in the dB and change it's status to '0'. I learned a lesson the hard way but am glad to see so many people willing to lend a hand. I'll remember to always test out the code in a story or page prior to ever attempting it in a block ever again. Again, thanks to all of you!

nancydru’s picture

You could also have edited the code there as well. Glad you got it resolved.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

jvandervort’s picture

I added a note to the javascript countdown timer docs that mention this issue with using the php code filter.

-John

-John