No longer use `avatarID`
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 8 Nov 2024 11:50:35 +0000 (12:50 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 8 Nov 2024 11:50:35 +0000 (12:50 +0100)
wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php
wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php
wcfsetup/install/files/lib/data/user/UserAction.class.php

index 63e9e1b32032e7af5bc050d48c104323cd684676..e10f4e1bcc607c5e35282f132d835b1267c7d877 100644 (file)
@@ -339,7 +339,7 @@ final class UserExportGdprAction extends AbstractAction
             }
         }
 
-        if ($this->user->avatarFileID !== null || $this->user->avatarID !== null) {
+        if ($this->user->avatarFileID) {
             $data['avatarURL'] = $this->user->getAvatar()->getURL();
         }
 
index c3fc12f02f131ed40b7abdb0b474c1c2dca54e89..df6189c4b78ce2528ac04f5dd4fad5814f5107aa 100644 (file)
@@ -86,9 +86,9 @@ class SystemCheckPage extends AbstractPage
 
     public $foreignKeys = [
         'wcf1_user' => [
-            'avatarID' => [
-                'referenceTable' => 'wcf1_user_avatar',
-                'referenceColumn' => 'avatarID',
+            'avatarFileID' => [
+                'referenceTable' => 'wcf1_file',
+                'referenceColumn' => 'fileID',
             ],
         ],
         'wcf1_comment' => [
index 96dd66b904d6e826cf81a12771a9d397c351280f..74522c11d09e8aaf2325478fb1b8902d5aa83689 100644 (file)
@@ -8,7 +8,6 @@ use wcf\data\file\FileAction;
 use wcf\data\IClipboardAction;
 use wcf\data\ISearchAction;
 use wcf\data\object\type\ObjectTypeCache;
-use wcf\data\user\avatar\UserAvatarAction;
 use wcf\data\user\group\UserGroup;
 use wcf\system\attachment\AttachmentHandler;
 use wcf\system\clipboard\ClipboardHandler;
@@ -140,19 +139,12 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
         }
 
         // delete avatars
-        $avatarIDs = $avatarFileIDs = [];
+        $avatarFileIDs = [];
         foreach ($this->getObjects() as $user) {
-            if ($user->avatarID) {
-                $avatarIDs[] = $user->avatarID;
-            }
             if ($user->avatarFileID !== null) {
                 $avatarFileIDs[] = $user->avatarFileID;
             }
         }
-        if (!empty($avatarIDs)) {
-            $action = new UserAvatarAction($avatarIDs, 'delete');
-            $action->executeAction();
-        }
         if (!empty($avatarFileIDs)) {
             (new FileAction($avatarFileIDs, 'delete'))->executeAction();
         }