You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is still a bug where the attachment will not be deleted from filesystem if it has not been written to the database yet. (reproduce by: edit post -> add attachment -> remove attachment without saving the reply) This is due the following code part:
$attachment = $model->getById($attachmentId);
// Make sure the user has permission to edit this post.$permission = false;
if (!empty($attachment[0]["postId"])) {
$post = ET::postModel()->getById($attachment[0]["postId"]);
$conversation = ET::conversationModel()->getById($post["conversationId"]);
$permission = ET::postModel()->canEditPost($post, $conversation);
}
else {
$permission = ET::$session->userId == $attachment[0]["draftMemberId"];
}
if (!$permission) {
$this->renderMessage(T("Error"), T("message.noPermission"));
returnfalse;
}
The problem is that since the attachment has yet to be written to the database the following part will return null.
$attachment = $model->getById($attachmentId);
and therefor you will hit
if (!$permission)
I could not find a quick solution to fix that part. Maybe you can look into it?
The text was updated successfully, but these errors were encountered:
@tobscure I have tried to fix the attachment plugin so removing attachments is now working as well. See my commit https://github.com/tristanvanbokkem/esoTalk/commit/c76eb510c2a5dda92089b5c4169b4412716f1c49 and https://github.com/tristanvanbokkem/esoTalk/commit/79506a117a929919466900931b9954b73aef14d3 (and https://github.com/tristanvanbokkem/esoTalk/commit/e3f5172de46e5f08125a9b17412e8c0c7b3fe86d for a tiny mistake)
There is still a bug where the attachment will not be deleted from filesystem if it has not been written to the database yet. (reproduce by: edit post -> add attachment -> remove attachment without saving the reply) This is due the following code part:
The problem is that since the attachment has yet to be written to the database the following part will return null.
and therefor you will hit
I could not find a quick solution to fix that part. Maybe you can look into it?
The text was updated successfully, but these errors were encountered: