Use `UserProfile` objects for newest members
authorMatthias Schmidt <gravatronics@live.com>
Tue, 26 May 2020 14:39:24 +0000 (16:39 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 26 May 2020 14:39:24 +0000 (16:39 +0200)
See #3321

wcfsetup/install/files/lib/system/cache/builder/UserStatsCacheBuilder.class.php

index 6594fe880aa1bc6202739669ec5c532115c4698d..d62035b6e124b8c2cf8ce974b7318ffea995c5cb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
-use wcf\data\user\User;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\WCF;
 
 /**
@@ -31,12 +31,12 @@ class UserStatsCacheBuilder extends AbstractCacheBuilder {
                $data['members'] = $statement->fetchColumn();
                
                // newest member
-               $sql = "SELECT          *
+               $sql = "SELECT          userID
                        FROM            wcf".WCF_N."_user
                        ORDER BY        userID DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 1);
                $statement->execute();
-               $data['newestMember'] = $statement->fetchObject(User::class);
+               $data['newestMember'] = UserProfileRuntimeCache::getInstance()->getObject($statement->fetchSingleColumn());
                
                return $data;
        }