How to Debug Drupal :: debug_backtrace()

Sometimes debuging Drupal can get confusing. I blame the lack of oop (we want you so bad Drupal 7) , the lack of mvc, and some kind of evil gnomes plans to take over the world (but more on this latter).

So in case you’re going crazy trying to figure out what goes wrong in some otherwise great Dru[pal module, here’s little function i got from an interesting article on lulabot about debugging Drupal:

function drupal_set_message($message = NULL, $type = ‘status’)
{
// DEBUG: Go track down that stinkin’ error…
if ($type == ‘error’)
{
$message .= ‘<pre>’. print_r(debug_backtrace(), 1) .'</pre>’;
}
if ($message) {

Aly Chiman

Aly Chiman is a Blogger & Reporter at AlyChiTech.com which covers a wide variety of topics from local news from digital world fashion and beauty . AlyChiTech covers the top notch content from the around the world covering a wide variety of topics. Aly is currently studying BS Mass Communication at University.