Skip to content
Snippets Groups Projects
Commit abf19a33 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #319401 by andypost, Crell, hswong3i: properly force default database in the dblog module.

parent d86d5546
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment