diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-26 14:11:38 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-26 14:11:38 +0000 |
commit | 53d16d7da0a45de7164a3ba5147fb7864be17531 (patch) | |
tree | 3f1748b77a2c7db39c7b092bc74057ea9c1fadc8 /includes/bootstrap.inc | |
parent | e6c9ae9889f249a9531b9936ed4c04680f26c9b3 (diff) | |
download | brdo-53d16d7da0a45de7164a3ba5147fb7864be17531.tar.gz brdo-53d16d7da0a45de7164a3ba5147fb7864be17531.tar.bz2 |
#42000, Watchdog can't log errors when using db_set_active(non-default), patch by Chris Johnson and myself
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r-- | includes/bootstrap.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 05b172bea..0728aaf8c 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -590,7 +590,14 @@ function request_uri() { */ function watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL) { global $user; + + $current_db = db_set_active(); + db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, request_uri(), referer_uri(), $_SERVER['REMOTE_ADDR'], time()); + + if ($current_db) { + db_set_active($current_db); + } } /** |