deprecated function
authordemeritcowboy <demeritcowboy@hotmail.com>
Wed, 2 Jun 2021 12:06:19 +0000 (08:06 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Wed, 2 Jun 2021 12:06:19 +0000 (08:06 -0400)
ext/authx/Civi/Authx/Drupal8.php

index 34debea936ba6c9d2b844ac523cf4cf05c41f99e..bb817e7b457c649d5596ed7a77445af2b17fb59b 100644 (file)
@@ -26,7 +26,7 @@ class Drupal8 implements AuthxInterface {
    * @inheritDoc
    */
   public function loginSession($userId) {
-    $user = user_load($userId);
+    $user = \Drupal\user\Entity\User::load($userId);
     user_login_finalize($user);
   }
 
@@ -41,7 +41,7 @@ class Drupal8 implements AuthxInterface {
    * @inheritDoc
    */
   public function loginStateless($userId) {
-    $user = user_load($userId);
+    $user = \Drupal\user\Entity\User::load($userId);
     // In theory, we could use either account_switcher->switchTo() or current_user->setAccount().
     // switchTo() sounds more conscientious, but setAccount() might be a more accurate rendition
     // of "stateless login". At time of writing, there doesn't seem to be a compelling difference.