public $foreignKeys = [
'wcf1_user' => [
- 'avatarID' => [
- 'referenceTable' => 'wcf1_user_avatar',
- 'referenceColumn' => 'avatarID',
+ 'avatarFileID' => [
+ 'referenceTable' => 'wcf1_file',
+ 'referenceColumn' => 'fileID',
],
],
'wcf1_comment' => [
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;
}
// 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();
}