News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Confusing behaviour when embedded attachment is deleted

Started by Sir Osis of Liver, May 19, 2022, 06:57:41 PM

Previous topic - Next topic

Sir Osis of Liver

Quote inserted for context after topic was split
Quote from: Sir Osis of Liver on May 19, 2022, 06:06:01 PMOr you can do this - You cannot view this attachment. with a tooltip.  ;) 

Quote from: Sesquipedalian on May 19, 2022, 12:27:12 AMAnyone who doesn't like the current behaviour can change it on their own install.
Sure, but we shouldn't have to.

Just as an aside, when I preview this post I get 'Not a valid attachment ID.' instead of the image.  It posted correctly, now it doesn't.

As expected, 2.1 is a mess. :P




Here's what's in the post -


Or you can do this - [attach id=281552]butt_ss1.png[/attach] with a tooltip.


If it wasn't a valid attachment thumb wouldn't work.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

FrizzleFried

The tag at can be fixed by changing 281552 to 281554. 

I am not sure why the tag ended up 2 numbers below your image number unless you'd attached an image... then deleted it... then re-uploaded an image and left the original tag?

Sir Osis of Liver

Didn't post the insert first try, uploaded it several times to try to get it to post correctly. 
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Sesquipedalian

Quote from: Sir Osis of Liver on May 19, 2022, 06:06:01 PM
Quote from: Sesquipedalian on May 19, 2022, 12:27:12 AMAnyone who doesn't like the current behaviour can change it on their own install.
Sure, but we shouldn't have to.



Quote from: Sir Osis of Liver on May 19, 2022, 06:06:01 PMJust as an aside, when I preview this post I get 'Not a valid attachment ID.' instead of the image.  It posted correctly, now it doesn't.

You have the wrong number specified in the id parameter of the attach BBCode. I suspect that you attached a file, inserted the BBCode, accidentally deleted the attachment, and then uploaded a fresh copy of the file. Or perhaps you were working in source view instead of WYSIWYG mode and simply made a typo. Either way, correct the id number in your post, and it'll work just fine.
Slava Ukraini!
Heroiam slava!

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sir Osis of Liver

Not a typo, nothing to do with WYSIWYG.  Just trying to attach a png, like any other dumb member, didn't work.  Bad enough it's poorly designed, it's buggy as well.  Not on my computer so can't replicate the glitch, will try tomorrow (if I remember).
"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Aleksi "Lex" Kilpinen

Looks like you previewed the post with Attachment id 281552,
but before you actually made the post it ID the attachment eventually had climbed to 281554.
I'm not sure what caused that, but it's worth looking at IMO @Sesquipedalian

EDIT: I was slow and missed the second page completely before posting :P Sorry about that.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sesquipedalian

Quote from: Aleksi "Lex" Kilpinen on May 20, 2022, 12:28:45 AMbefore you actually made the post it ID the attachment eventually had climbed to 281554.
I'm not sure what caused that, but it's worth looking at IMO @Sesquipedalian

That can't happen. Every attachment, even if it is just a preview that is discarded before the post is submitted, is assigned a unique, permanent ID number. That ID number will never change, no matter how many other attachments might be uploaded before the post is submitted.

Since Sir Osis said that he uploaded copies of the file several times, the only explanation I can see is the scenario that both I and FrizzleFried described:

Quote from: FrizzleFried on May 19, 2022, 06:58:11 PMI am not sure why the tag ended up 2 numbers below your image number unless you'd attached an image... then deleted it... then re-uploaded an image and left the original tag?
Quote from: Sesquipedalian on May 19, 2022, 07:50:19 PMI suspect that you attached a file, inserted the BBCode, accidentally deleted the attachment, and then uploaded a fresh copy of the file.
Slava Ukraini!
Heroiam slava!

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sesquipedalian

#7
Thinking more about it, Sir Osis' confusion probably arose because the editor's thumbnail preview does not disappear when an attachment is deleted. We could improve that by adding some JavaScript to remove the attach BBC from the post text in the editor when the attachment is deleted.
Slava Ukraini!
Heroiam slava!

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

@rjen

This exact same problem is reported to me as well by forum users. It seems to happen more often
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl
Testing SMF 2.1 with next version TinyPortal at test.fjr-club.nl

Sesquipedalian

Slava Ukraini!
Heroiam slava!

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Antechinus

If you're interested, there's a simple CSS tweak which will also immediately hide the deleted ones in the attachments preview:
.dz-complete.errorbox {
display: none;
}

I'm running it on local already, and I'm liking it quite a lot. ;)

Sir Osis of Liver

#11
IIRC, first attempt to insert the image failed.

It's failed again in preview, first upload, no delete - You cannot view this attachment.

But as you can see it posted correctly.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Sir Osis of Liver

test - You cannot view this attachment.

Fails every time.  Add file > Upload > Insert > Preview

You cannot view this attachment.

Posts ok.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Sir Osis of Liver

The ui is unecessarily complicated.  There are seven buttons after you've added one file, two more for each additional file.  Uploading should not be a separate step, once added all attachments should upload on post, as in 2.0.  That would greatly simplify things.  It's ridiculous the way it is now.


"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Arantor

There is actually one side point to this method - though certainly not this presentation - that you can theoretically handle attachments that are larger than the server would normally let you upload in one go.

We haven't seen that for a while as a support question - I guess hosts are more lax than they used to be - but there was a time you couldn't upload several files together because it'd be too big for the server to cope with in a single go. Which is what this was *trying* to deal with.

But there are vastly better ways of presenting this.

FrizzleFried


Antechinus

Quote from: Arantor on May 20, 2022, 01:22:34 PMThere is actually one side point to this method - though certainly not this presentation - that you can theoretically handle attachments that are larger than the server would normally let you upload in one go.

We haven't seen that for a while as a support question - I guess hosts are more lax than they used to be - but there was a time you couldn't upload several files together because it'd be too big for the server to cope with in a single go. Which is what this was *trying* to deal with.
It's a fair point, and one that may not be relevant to hosts anymore but can still be relevant to connections, especially on mobile. I'm not that fussed about having to have an upload button if the  "Upload all" option is available (and obviously available) for connections that can deal with it.

Arantor

You could still have upload all do it out of band and return the ids for inclusion into the post. It's still bad UX even taking that factor into account and it can and I would argue should be improved.

Antechinus


Sir Osis of Liver

Quote from: Sesquipedalian on May 20, 2022, 01:28:25 AMThinking more about it, Sir Osis' confusion probably arose because the editor's thumbnail preview does not disappear when an attachment is deleted.

I'm not confused, the [email protected]#king thing doesn't work.  Nothing to do with deleting attachement, as posted above, it doesn't work.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Advertisement: