In the following code it says that it will log to the database if it is set to 1, and log to the screen if it is set to 2. Well, as it stands, it logs to the screen if it's one and not two.

very easy fix, just change the two 1s to 2s.

/**
 * Log errors as defined by administrator
 * Error levels:
 *  1 = Log errors to database.
 *  2 = Log errors to database and to screen.
 */
function error_handler($errno, $message, $filename, $line) {
  if ($errno & (E_ALL ^ E_NOTICE)) {
    $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning');
    $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.';

    if (variable_get('error_level', 1) == 1) {
      print '<code>'. $entry .'

';
}

CommentFileSizeAuthor
#1 common_12.patch680 bytesUwe Hermann
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Uwe Hermann’s picture

Version: 4.6.1 » x.y.z
Status: Active » Needs review
FileSize
680 bytes

AFAIK it's not the code that is wrong but the docs. Here's a patch. Someone should review this before committing.

Dries’s picture

Status: Needs review » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)