forked from GNUsocial/gnu-social
[Profile][User_group] Fix profile deletion violating foreign keys
This commit is contained in:
@@ -978,6 +978,13 @@ class Profile extends Managed_DataObject
|
||||
$this->_deleteAttentions();
|
||||
Avatar::deleteFromProfile($this, true);
|
||||
|
||||
$this->grantRole(Profile_role::DELETED);
|
||||
|
||||
$localuser = User::getKV('id', $this->id);
|
||||
if ($localuser instanceof User) {
|
||||
$localuser->delete();
|
||||
}
|
||||
|
||||
// Warning: delete() will run on the batch objects,
|
||||
// not on individual objects.
|
||||
$related = [
|
||||
@@ -993,13 +1000,6 @@ class Profile extends Managed_DataObject
|
||||
$inst->delete();
|
||||
}
|
||||
|
||||
$this->grantRole(Profile_role::DELETED);
|
||||
|
||||
$localuser = User::getKV('id', $this->id);
|
||||
if ($localuser instanceof User) {
|
||||
$localuser->delete();
|
||||
}
|
||||
|
||||
return parent::delete($useWhere);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user