forked from GNUsocial/gnu-social
Delete the notice *and* the photo
This commit is contained in:
parent
35e0832ec0
commit
57aef10ed2
@ -182,20 +182,15 @@ class EditphotoAction extends Action
|
|||||||
//For redirection
|
//For redirection
|
||||||
$oldalbum = $this->album_id;
|
$oldalbum = $this->album_id;
|
||||||
|
|
||||||
$this->photo->title = "";
|
$notice = Notice::staticGet('id', $this->photo->notice_id);
|
||||||
$this->photo->photo_description = "";
|
|
||||||
$this->photo->profile_id = 0;
|
|
||||||
$this->photo->album_id = 0;
|
|
||||||
$this->photo->uri = "";
|
|
||||||
$this->photo->thumb_uri = "";
|
|
||||||
|
|
||||||
if ($this->photo->validate())
|
$this->photo->delete();
|
||||||
$this->photo->update();
|
|
||||||
else {
|
if (Event::handle('StartDeleteOwnNotice', array($this->user, $notice))) {
|
||||||
$this->showForm(_('Error: The photo data is not valid.'));
|
$notice->delete();
|
||||||
return;
|
Event::handle('EndDeleteOwnNotice', array($this->user, $notice));
|
||||||
}
|
}
|
||||||
$this->showForm(_('Success!'));
|
$this->showForm(_('Success!'));
|
||||||
common_redirect('/' . $this->user->nickname . '/photos/' . $oldalbum, '303');
|
common_redirect('/' . $this->user->nickname . '/photos/' . $oldalbum, '303');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user