Skip to content
Snippets Groups Projects
Commit a0e5302d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2287777 by andypost: Optimize _dblog_get_message_types().

parent eb2bfe7d
No related branches found
No related tags found
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
......@@ -87,14 +87,8 @@ function dblog_cron() {
* List of uniquely defined database log message types.
*/
function _dblog_get_message_types() {
$types = array();
$result = db_query('SELECT DISTINCT(type) FROM {watchdog} ORDER BY type');
foreach ($result as $object) {
$types[] = $object->type;
}
return array_combine($types, $types);
return db_query('SELECT DISTINCT(type) FROM {watchdog} ORDER BY type')
->fetchAllKeyed(0, 0);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment