mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
Fix for deleting photos that don't have albums
This commit is contained in:
parent
a859fa13a5
commit
ab1c6dc843
1 changed files with 4 additions and 1 deletions
|
@ -336,7 +336,10 @@ final class PhotosPresenter extends OpenVKPresenter
|
||||||
if(is_null($this->user) || $this->user->id != $ownerId)
|
if(is_null($this->user) || $this->user->id != $ownerId)
|
||||||
$this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
|
$this->flashFail("err", tr("error_access_denied_short"), tr("error_access_denied"));
|
||||||
|
|
||||||
$redirect = $photo->getAlbum()->getOwner() instanceof User ? "/id0" : "/club" . $ownerId;
|
if(!is_null($album = $photo->getAlbum()))
|
||||||
|
$redirect = $album->getOwner() instanceof User ? "/id0" : "/club" . $ownerId;
|
||||||
|
else
|
||||||
|
$redirect = "/id0";
|
||||||
|
|
||||||
$photo->isolate();
|
$photo->isolate();
|
||||||
$photo->delete();
|
$photo->delete();
|
||||||
|
|
Loading…
Reference in a new issue