Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / user / src / UserStorage.php
index 809f3e384b73ee51827eccd5b15e85d88babcd86..7ca4f24343fe55d514926c67285d322e2c29eefa 100644 (file)
@@ -21,7 +21,7 @@ class UserStorage extends SqlContentEntityStorage implements UserStorageInterfac
     // The anonymous user account is saved with the fixed user ID of 0.
     // Therefore we need to check for NULL explicitly.
     if ($entity->id() === NULL) {
-      $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {users}')->fetchField());
+      $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {' . $this->getBaseTable() . '}')->fetchField());
       $entity->enforceIsNew();
     }
     return parent::doSaveFieldItems($entity, $names);
@@ -39,7 +39,7 @@ class UserStorage extends SqlContentEntityStorage implements UserStorageInterfac
    * {@inheritdoc}
    */
   public function updateLastLoginTimestamp(UserInterface $account) {
-    $this->database->update('users_field_data')
+    $this->database->update($this->getDataTable())
       ->fields(['login' => $account->getLastLoginTime()])
       ->condition('uid', $account->id())
       ->execute();
@@ -51,7 +51,7 @@ class UserStorage extends SqlContentEntityStorage implements UserStorageInterfac
    * {@inheritdoc}
    */
   public function updateLastAccessTimestamp(AccountInterface $account, $timestamp) {
-    $this->database->update('users_field_data')
+    $this->database->update($this->getDataTable())
       ->fields([
         'access' => $timestamp,
       ])