Auto remove attachment added in post when an attachment is deleted

  • Lets say I upload an image, then click add full size image to post. Later I edit the post and delete the attachment file, then save post again. The post has not auto removed the full-size image I inserted into it. When an attachment is removed it should also auto remove it from post as well if inserted into it, like inserting a full-size image.


    I just did exactly that with this image below. Deleted the attachment and not the full sized inserted image link. Many people are going to delete attachments and not bother also removing the full-sized image of it inserted in the post. So it should be auto done thing removing it from posts like phpBB does it I used before to avoid broken attachment links left behind in posts


    woltlab.com/attachment/106276/

  • I disagree and imagine if somebody ran WBB using it for a Photography board, where you get people uploading and deleting attachments all the time in the form of images used in posts. It makes complete sense to remove the attachment link from a post when an attachment gets deleted. Not everyone (believe me) can be bothered removing both the attachment from post - when deleting the file.


    What do you have against it deleting the attachment link from post 'auto' when an attachment file is deleted? You don't give any reason why you're against it for, other than you just think users should remove it themselves (which won't happen all the time). Then over a period of time you'll end up with loads of dead invalid attachments link in posts listed.

    • Official Post

    Uh, this is already the case? Embedded image attachments are removed from the editor when the attachment is removed, just tried it again. This does not happen in non-WYSIWYG mode though.

  • Look at my first post and click the invalid image link left behind.


    1. Upload image attachment
    2. Click to insert it as a 'full sized image link in post'.
    3. Delete attachment file.


    The full sized image link doesn't get auto removed

  • Eh? All you show is you uploading an image and then clicking 'add full screen image' to post and the video stops?


    What has that got to do with you then 'after that'.. you deleting the attachment file, save post, and the full size image link is still left behind (as an invalid link) in posts when you save it.


    My first post shows you the problem.


    1. Upload image attachment
    2. Click to insert it as a 'full sized image link in post'.
    3. Save the post
    4. edit the post and delete attachment file.
    5. save post


    woltlab.com/attachment/106286/

  • 1. Upload image attachment
    2. Click to insert it as a 'full sized image link in post'.
    3. Save the post
    4. edit the post and delete attachment file.
    5. save post


    I've showed you in two posts now here in this topic how it happens with two dead attachment links listed

  • Try using this image I tested it with. It doesn't give you option to 'insert as full-size', only to insert it in post. I think what is happening here (maybe) is you're using a far bigger image that might work for removing it from post. But it doesn't work for this image because a link is added, not a live picture view of it in post before submitting it.

  • Yep, I just tested using a larger image and sorry, you are correct in that the image gets removed from post when you delete the attachment. What I overlooked is the image I've been using is far smaller so a link gets inserted rather than a image preview before you save post. So my mistake, it seems related to smaller images inserted in posts that will add a link and not a picture of it - when you click: insert into message


    If you then delete the attachment you'll see the image link remains in post listed

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!