- Patch #598586 by grendzy, deekayen: watchdog() assumes is defined.

merge-requests/26/head
Dries Buytaert 2011-04-10 18:59:06 +02:00
parent b522d3dc5a
commit 0aba395ce1
1 changed files with 4 additions and 1 deletions

View File

@ -138,9 +138,12 @@ function _dblog_get_message_types() {
* Note some values may be truncated for database column size restrictions.
*/
function dblog_watchdog(array $log_entry) {
// The user object may not exist in all conditions, so 0 is substituted if needed.
$user_uid = isset($log_entry['user']->uid) ? $log_entry['user']->uid : 0;
Database::getConnection('default', 'default')->insert('watchdog')
->fields(array(
'uid' => $log_entry['user']->uid,
'uid' => $user_uid,
'type' => substr($log_entry['type'], 0, 64),
'message' => $log_entry['message'],
'variables' => serialize($log_entry['variables']),