Posted by Elephant789 on August 12, 2007 at 12:20am
After creating a block with this snippet:
<?
$nid = 10;
$node_for_TOC = node_load($nid);
print category_display_toc($node_for_TOC);
?>
I now get the following error:
Fatal error: Call to undefined function: category_display_toc() in /home/mysite/public_html/includes/common.inc(1201) : eval()'d code on line 4
Now I can't access my site. Any help?
Thanks.
Comments
Disable a block
You can disable all custom blocks, which will get you access to the site again. Then you can re-enable the ones that are OK and fix the one that's broken.
Edit the file sites/default/settings.php and add this at the end:
function custom_url_rewrite($a, $b, $c)
{ db_query("UPDATE blocks SET status = 0 WHERE module = 'block' ");
return $b;
}
After you're in again, delete that function.
P.S. - I don't think this works on 4.x. You'll need to find another way to execute that SQL query. You can find the database name, user, and password in settings.php -- look for $db_url. Then do this:
mysql -uuser -ppassword database
filling in the appropriate values for user, password, and database
Then you can execute the query shown above.
Please help me, I am blocked and can not disable it
Hi, djordman, can you help me? Something has happened in my site. I can not enter because ther is always a pink-red note saying "yourname" is disabled or has been blocked", of course it is an error that occurred without knowing how,
Best regards
margagua@uio.satnet.net
undo login
Wild guess: in your browser settings, delete all cookies. Then you should be able to log in as administrator.
Recover from "fatal error" after creating custom block with PHP
This was a life saver!
Many thanks David.
LTC.Wrath-BRIG-XO
http://dfbrigade.org
wrath|at|dfbrigade.org
LTC.Wrath-BRIG-XO
http://dfbrigade.org
wrath|at|dfbrigade.org
Live saver
Your a live saver.. thx..
in the future test php
in the future test php snippets , using the page content type, where if it doesn't work it won't shut your site down. Once you get the snippet working in a page, then you can safely transfer it to a block.
_____________________________________________________________________________________________
give a person a fish and you feed them for a day but ... teach a person to fish and you feed them for a lifetime
I got it, thanks.
I got it, thanks.