Skip to content

Commit

Permalink
No longer use avatarID
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyperghost committed Nov 8, 2024
1 parent 8f06441 commit 3007ce3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ protected function exportUser()
}
}

if ($this->user->avatarFileID !== null || $this->user->avatarID !== null) {
if ($this->user->avatarFileID) {
$data['avatarURL'] = $this->user->getAvatar()->getURL();
}

Expand Down
6 changes: 3 additions & 3 deletions wcfsetup/install/files/lib/acp/page/SystemCheckPage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
10 changes: 1 addition & 9 deletions wcfsetup/install/files/lib/data/user/UserAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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;
Expand Down Expand Up @@ -140,19 +139,12 @@ public function delete()
}

// 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();
}
Expand Down

0 comments on commit 3007ce3

Please sign in to comment.