WSOD when run via direct link in browser:

DRUPAL_ROOT is /home/account/public_html/drupal.
Bootstrapping to DRUPAL_BOOTSTRAP_SESSION

Fatal error: Call to undefined function user_preferred_language() in /home/account/public_html/drupal/sites/all/modules/logging_alerts/errorlog/errorlog.module on line 45

Comments

rfay’s picture

Please use the drush version, as it's more likely to work any time. We'll probably drop the direct link out of there.

deanflory’s picture

Thanks, will check it out. I haven't used Drush yet but maybe this will be the instance that forces me to see the light.

batje’s picture

Project: Registry Rebuild » Logging and alerts
Version: 7.x-1.9 » 7.x-2.1

this is an error in logging and alerts (the value is not used at all in the remainder of the function, if you remove the function, the next issue is that the theme() function is unknown.

This happens when logging&alert watchdog is called very early in the bootstrap process. I did this to solve it:

  if (variable_get('errorlog_' . $log['severity'], FALSE)) {
    // Remove this:
    // $language = user_preferred_language($log['user']);

    // Make sure that $log['variables'] is always an array to avoid
    // errors like in issue http://drupal.org/node/1325938
    if (!is_array($log['variables'])) {
      $log['variables'] = array();
    }

    // Send themed alert to the web server's log. But only if the theme function exists
    if (function_exists('theme')) {
      $message = theme('errorlog_format', $log);
    }
    else {
      $message = print_r($log);
    }
    error_log($message);
  }

maciej.zgadzaj’s picture

Thanks Reinier. Please roll that into a patch.

maciej.zgadzaj’s picture

Status: Active » Fixed

Fixed in both 7.x-2.x and 6.x-2.x branches, just pushed to d.o.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.