- Patch #598586 by grendzy, deekayen: watchdog() assumes is defined.
parent
b522d3dc5a
commit
0aba395ce1
|
@ -138,9 +138,12 @@ function _dblog_get_message_types() {
|
||||||
* Note some values may be truncated for database column size restrictions.
|
* Note some values may be truncated for database column size restrictions.
|
||||||
*/
|
*/
|
||||||
function dblog_watchdog(array $log_entry) {
|
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')
|
Database::getConnection('default', 'default')->insert('watchdog')
|
||||||
->fields(array(
|
->fields(array(
|
||||||
'uid' => $log_entry['user']->uid,
|
'uid' => $user_uid,
|
||||||
'type' => substr($log_entry['type'], 0, 64),
|
'type' => substr($log_entry['type'], 0, 64),
|
||||||
'message' => $log_entry['message'],
|
'message' => $log_entry['message'],
|
||||||
'variables' => serialize($log_entry['variables']),
|
'variables' => serialize($log_entry['variables']),
|
||||||
|
|
Loading…
Reference in New Issue