Drupal from 10.6.17 to 11.4.7
This commit is contained in:
@@ -35,17 +35,17 @@ function login_tracker_user_login($account) {
|
||||
\Drupal::moduleHandler()->alter('login_tracker_login_data', $data, $account);
|
||||
$data = serialize($data);
|
||||
|
||||
$keys = [
|
||||
'record_id' => NULL,
|
||||
];
|
||||
$fields = [
|
||||
'uid' => $account->id(),
|
||||
'login_timestamp' => \Drupal::time()->getRequestTime(),
|
||||
'data' => $data,
|
||||
];
|
||||
|
||||
\Drupal::database()->merge('login_tracker')
|
||||
->key($keys)
|
||||
// Core 11 narrowed Merge::key() to a string field, so the historical
|
||||
// merge->key(['record_id' => NULL]) trick no longer works. A plain insert
|
||||
// is exactly what it did (the NULL key never matched, forcing an insert
|
||||
// per login).
|
||||
\Drupal::database()->insert('login_tracker')
|
||||
->fields($fields)
|
||||
->execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user