Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 .'
';
}
Comment | File | Size | Author |
---|---|---|---|
#1 | common_12.patch | 680 bytes | Uwe Hermann |
Comments
Comment #1
Uwe Hermann CreditAttribution: Uwe Hermann commentedAFAIK it's not the code that is wrong but the docs. Here's a patch. Someone should review this before committing.
Comment #2
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #3
(not verified) CreditAttribution: commentedComment #4
(not verified) CreditAttribution: commentedComment #5
(not verified) CreditAttribution: commented