From abf19a337fcacb8f9eefda79a817c7d9c4c2458a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 26 Feb 2010 15:25:43 +0000 Subject: - Patch #319401 by andypost, Crell, hswong3i: properly force default database in the dblog module. --- modules/dblog/dblog.module | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'modules/dblog') diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index cbbd381a8..280989887 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -83,8 +83,6 @@ function dblog_init() { } } - - /** * Implements hook_cron(). * @@ -93,8 +91,8 @@ function dblog_init() { function dblog_cron() { // Cleanup the watchdog table if (variable_get('dblog_row_limit', 1000) > 0) { - $max = db_query('SELECT MAX(wid) FROM {watchdog}')->fetchField(); - db_delete('watchdog') + $max = Database::getConnection('default', 'default')->query('SELECT MAX(wid) FROM {watchdog}')->fetchField(); + Database::getConnection('default', 'default')->delete('watchdog') ->condition('wid', $max - variable_get('dblog_row_limit', 1000), '<=') ->execute(); } -- cgit v1.2.3