1

I currently have the following code in my drupal_set_message()

1778 function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
1779   if ($message) {
1780    if ($type == 'error') {
1781        $message .= ' '. print_r(debug_backtrace(), 1) .' ';
1782    }
1783
1784     if (!isset($_SESSION['messages'][$type])) {
1785       $_SESSION['messages'][$type] = array();
1786     }
1787
1788     if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
1789       $_SESSION['messages'][$type][] = $message;
1790     }
1791
1792     // Mark this page as being uncacheable.
1793     drupal_page_is_cacheable(FALSE);
1794   }
1795
1796   // Messages not set when DB connection fails.
1797   return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
1798 }

I'm trying to do a debug_backtrace on this function to find out which module is causing my error. Whenever i reload the page, I only get a white screen of death.

What could i be doing wrong here? Or what other quick methods like this can I find a module that is causing issues?

3
  • 1
    The only way to find out why a 500 error happens is to look at your server logs, there are just too many possible causes to try guessing. Might be that you have XDebug installed and the array you're piping through causes it to exceed the max nesting level, for example. The error message will let you know what you need to do next
    – Clive
    Nov 6, 2015 at 9:49
  • i dont have xdebug installed and i just want to konw the output of debug backtrace. if i remove debug_backtrace it works, but when i put it back i dont get any type of error output. im guessing debug_backtrace is timing out the server. Nov 6, 2015 at 15:50
  • Don't guess - look at your server logs, then you'll know. Q+A isn't for random guesses as you know, but once you've found the error message, if you can't find how to fix it in the context of Drupal, just update this or ask another question :)
    – Clive
    Nov 6, 2015 at 15:52

0

Browse other questions tagged or ask your own question.