From 3007ce348453aab03158bd2da634343a6e0291ee Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 8 Nov 2024 12:50:35 +0100 Subject: [PATCH] No longer use `avatarID` --- .../lib/acp/action/UserExportGdprAction.class.php | 2 +- .../files/lib/acp/page/SystemCheckPage.class.php | 6 +++--- .../install/files/lib/data/user/UserAction.class.php | 10 +--------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php b/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php index 63e9e1b320..e10f4e1bcc 100644 --- a/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php @@ -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(); } diff --git a/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php b/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php index c3fc12f02f..df6189c4b7 100644 --- a/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php @@ -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' => [ diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index 96dd66b904..74522c11d0 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -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(); } -- 2.20.1