News:

Wondering if this will always be free?  See why free is better.

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

FrizzleFried

(1) Upload (just did that)

(2) Insert: 

You cannot view this attachment.

(3) Preview:

You cannot view this attachment.

(4) OP is 100% correct.  This behavior is not correct.   

Antechinus

I have no idea what you mean. All I see is two inline attachments in this post, and a screenshot of the editor. Try using more words. :P

ETA: Oh hang on, the error box in the preview shot. Got it.

Funnily enough, I had an error with the attachments system on a local test site the other night. I have not yet tried to replicate it, because honestly I think the only way of replicating it would be by repeatedly adding and removing attachment until it randomly happens again, and that could take ages. However...

I was testing adding and removing attachments (tweaking presentation) and I uploaded a new attachment, inserted it into the test post by clicking the insert button, and after saving the post I was presented with the "No message is associated with this attachment" message inside the post.

So, I go back into the editor to check it out, and I find that the attachment was inserted with its ID number off by 1. Note that this cannot possibly be a manual editing error, because the insertion was done via the insert button. So. it was handled directly by the SMF back end with no possibility for human error.

Despite this, it still came up with "ID + 1" for the value it inserted into the post.

Obvious question: is Ant hallucinating? Not unless Arantor is too, because I mentioned this to him via PM and he said he has occasionally seen the same error. Nothing in the error log either, before anyone asks.

Sir Osis of Liver

Nothing occasional about it, happens every time -

You cannot view this attachment.


Add file > upload > insert > preview



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Antechinus

I didn't preview though. I just uploaded, inserted, and saved. So, different issue.

ETA: Just tried doing a test your way on local. No problem. Preview works as it should. Saved post is fine. So, not an "all the time" issue for everyone.

Sir Osis of Liver

It's an attachment id error, that shouldn't be client side.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

FrizzleFried

Oddly... while this issue is 100% repeatable HERE for me.  Every time.  I have ZERO issue with the same exact procedure on both my sandbox and main sites...

So I can't explain it unless it's a permissions issue as I obviously don't have admin access here.  Maybe when I have a little time I'll test as a user on my sites.


Antechinus


Antechinus

You cannot view this attachment.

Yup. Confirmed. Immediate hit here. FIrefox on W10.

But, it only affects the preview. The submitted post is fine.

FrizzleFried

FWIW ... I just tried a USER account at my main site and in both WYSIWYG and TEXT MODE editors using the exact procedure above that I have the same result as OP here with... I have no issues at all on my local site.

FrizzleFried

Quote from: Antechinus on May 21, 2022, 11:44:17 PMYou cannot view this attachment.

Yup. Confirmed. Immediate hit here. FIrefox on W10.

But, it only affects the preview. The submitted post is fine.

Correct... exact same behavior I experience here ... but on Chrome.  I do NOT experience this same behavior on either of my local sites using either editor it seems.

Sir Osis of Liver

Confirmed, doesn't happen on 2.1 test install, only here.

Running a later version here?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

FrizzleFried

Oh,  I should mention that my sandbox site is 2.1.2 and main site is 2.1.1 so it's not a version thing.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Oldiesmann

I was able to reproduce the problem on my test board. Running the latest code from GitHub, PHP 8.1.6, MariaDB 10.3.34, APCu caching. Interesting how it shows just fine in WYSIWYG mode but not when I preview it.

You cannot view this attachment.
Michael Eshom
Christian Metal Fans

Sesquipedalian

Okay, to summarize, this bug occurs consistently for people on this site, but not on their own sites and test installs, except for Oldiesmann. Is that correct, everyone?

@Oldiesmann:

  • In that screenshot, the BBCode string in the attachment info box says the attachment ID number is 6. Is 6 really the correct ID number for the attachment, or should it have been 4 or 5 or something else?
  • Do you see any difference in behaviour if the editor is in WYSIWYG mode vs. source mode when you click the INSERT button and then generate the preview?
  • Am I correct to assume that the test forum has no mods installed?

@Sir Osis of Liver: When I said "confusion" I was not trying to deny that you were seeing what you were seeing. It was simply that the only way I could reproduce the same output on my test install was to delete and reattach a file, and because the editor's thumbnail preview was not deleted when I performed those steps—which is indeed confusing to anyone—I supposed that this confusing behaviour of the UI was the source of the problem.
I promise you nothing.

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

Oldiesmann

Quote from: Sesquipedalian on May 24, 2022, 11:54:08 AMOkay, to summarize, this bug occurs consistently for people on this site, but not on their own sites and test installs, except for Oldiesmann. Is that correct, everyone?

@Oldiesmann:

  • In that screenshot, the BBCode string in the attachment info box says the attachment ID number is 6. Is 6 really the correct ID number for the attachment, or should it have been 4 or 5 or something else?
  • Do you see any difference in behaviour if the editor is in WYSIWYG mode vs. source mode when you click the INSERT button and then generate the preview?
  • Am I correct to assume that the test forum has no mods installed?

6 is the correct ID for that attachment. 7 is the thumbnail for that one.
No difference between the two modes
No mods installed at the moment. It has had mods installed at other times though.
Michael Eshom
Christian Metal Fans

Sir Osis of Liver

Works correctly on clean 2.1.2 install from current upgrade package.  Doesn't work here.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

#37
Quote from: Sir Osis of Liver on May 24, 2022, 05:11:50 PMWorks correctly on clean 2.1.2 install from current upgrade package.  Doesn't work here.

Yep.  That's exactly why some (like me... ::)) couldn't reproduce.  The issues were primarily in current GitHub, and this site is often closer to current GH than 2.1.2. 

PR submitted: https://github.com/SimpleMachines/SMF/pull/7497
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

The upload/insert/preview issue should be addressed on this site.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: