Skip to content

Commit

Permalink
Revert "UPD code"
Browse files Browse the repository at this point in the history
This reverts commit fef0203.
  • Loading branch information
tretdm committed Oct 19, 2023
1 parent fef0203 commit 1c3d4d8
Show file tree
Hide file tree
Showing 2 changed files with 313 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Web/Presenters/PhotosPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ function renderDeletePhoto(int $ownerId, int $photoId): void
if(is_null($this->user) || $this->user->id != $ownerId)
$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->delete();
Expand Down
Loading

0 comments on commit 1c3d4d8

Please sign in to comment.