Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: CrescentEclipse on May 20, 2015, 06:24:51 AM

Title: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on May 20, 2015, 06:24:51 AM
Hi there,

I am currently using SMF 2.0.10 with Firefox 38.0.1 and wanted to enable file attachments in posts.
This is the first time I enabled this feature, so I have no reference to previous releases!

While testing the functionality I tried to limit the possible file extensions. I wanted to upload a not supported file and, like expected, got an error message. So far so good. I clicked the "go back" link and deleted the attachment. But I can't save the post. The button seems to be dead, nothing happens. However, the preview button works.

I searched the web and only found this problem related to the new SMF 2.1 in combination with Firefox. But this also seems to produce trouble in SMF 2.0.x. Any suggestions? Do I miss something important?

Thank you!

LG Cres
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: a10 on May 20, 2015, 06:51:14 AM
Same here on ff 38.0.1, fix > after clearing the "...that type of file", f5 to refresh browser, then save.
Save after preview works ok.

In IE 11, save works after going back.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on May 20, 2015, 09:51:15 AM
Hm, what do you mean by -> clearing the "...that type of file" ?
Save after preview does not work for me. Save button remains dead.

EDIT

Removing the disallowed file (I mean this was your suggestion?) and reloading the page works.
Any possible fix for this issue? I think this temporary solution would be to "complicated" for the standard user.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: Kindred on May 20, 2015, 10:42:08 AM
actually, from your description, this would seem to be working as intended.

You try to upload a file that is not allowed.
the system shows an error message
you go back to edit the post

if you tried to save it again, with the "bad" file, you'd get an error...   so it won't let you do that. You can't click save until you remove the "bad" file attachment.   That seem completely logical to me.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: Illori on May 20, 2015, 10:44:24 AM
Quote from: CrescentEclipse on May 20, 2015, 06:24:51 AM
The button seems to be dead, nothing happens. However, the preview button works.


i believe that is a known issue... i dont recall if it was fixed or not.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: margarett on May 20, 2015, 10:47:03 AM
Yes, I also confirm this.

This is again one of the JavaScript changes that Firefox implemented in latest versions and, unfortunately, they continue to break functionality :(

edit: and no, this is not working as intended (I mean, it is, just not in FF)
Illori: no, the other problems are just related to the WYSIWYG editor.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on May 20, 2015, 10:58:13 AM
Sry, maybe my description was misleading, but margarett understood it.

@Kindred
Yes, normally this is what should be done and sounds logical, but there is no error message ever again. Even if you remove the file, nothing happens after clicking the button. It is just dead due to an JS change in FF, like margarett explained.

Hmm... is there anything I can temporary do to circumvent this?
I do not want to use a feature which is not working properly at the moment. I hope you don't get me wrong :)
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: Illori on May 20, 2015, 11:31:23 AM
Quote from: margarett on May 20, 2015, 10:47:03 AM
Yes, I also confirm this.

This is again one of the JavaScript changes that Firefox implemented in latest versions and, unfortunately, they continue to break functionality :(

edit: and no, this is not working as intended (I mean, it is, just not in FF)
Illori: no, the other problems are just related to the WYSIWYG editor.

known issue for several [many] years http://dev.simplemachines.org/mantis/view.php?id=3780
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: margarett on May 20, 2015, 11:35:29 AM
OK so this is not a "new issue" as I thought, yet only FF is affected by it. I understand (more or less) why it happens but my JS nullity ( ;D ) prevents me from reaching its guts :P

IMO the best fix is to prevent the fatal error to be called, instead present an error message at the beginning of the post page, pretty much like any other post'ing error does. Not yet sure how hard this is, but I'll look into it...
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: Kindred on May 20, 2015, 11:55:36 AM
I believe that the problem here, and hence the reason the error is where it is, lies with the file upload
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: margarett on May 20, 2015, 07:08:16 PM
Not really. It's fixed in 2.1 by not provoking a fatal error in attachment errors. That's *the* problem...
You can always delete the uploaded file if it triggers an error.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on May 29, 2015, 03:46:26 AM
Quote from: margarett on May 20, 2015, 11:35:29 AM
IMO the best fix is to prevent the fatal error to be called, instead present an error message at the beginning of the post page, pretty much like any other post'ing error does. Not yet sure how hard this is, but I'll look into it...

Hi. Sry to push this up again, but have you found some trails to a possible fix? LG
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: margarett on May 29, 2015, 05:35:51 AM
I did investigate a bit. The change is really big and I still had no time to try it out... :(
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: a10 on May 29, 2015, 07:08:41 AM
Just a remark, have never seen any members reacting to this, and expect them to read the forum's settings\rules before trying to upload anything (see attachment), if they don't it's their problem :O) But, yes, getting firefox to behave like other browsers in the specific situation would be nice, but zero hurry here.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on June 01, 2015, 09:57:35 AM
Quote from: a10 on May 29, 2015, 07:08:41 AM
if they don't it's their problem :O)

Doesn't sounds user-friendly, does it?
In my opinion a program has to be fool-proof, otherwise it is not a good program. Simple as that.
I am a hobby programmer and my applications are written with this natural rule in mind. Think like an average user.

But, that is only my point of view. Maybe I only misunderstood you and you think the same.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: a10 on June 01, 2015, 01:47:31 PM
^^^ As written, would be ok to see it fixed. Entirely up to the developpers whatever they choose to do.

btw, only posted originally to confirm the ff behaviour. With members on my forum continuously posting attachments, none have ever mentionned hitting the ff + disallowed filetype combination (maybe they read the info before posting to avoid getting into problems :O) so here at least it's zero hurry + zero consequence + zero need for any fix.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on June 02, 2015, 05:51:10 AM
Hm, okay.
Maybe it's not a big problem anyway, but I don't want to have confused users after they really tried to do something special.
Besides, the same problem would occur if a file bigger than the size limit is uploaded, correct? I think this scenario is far more often.
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: margarett on June 10, 2015, 07:05:06 PM
Just came across this when searching for other stuff
http://custom.simplemachines.org/mods/index.php?mod=3255

Maybe this can help?
Title: Re: Can't update post after receiving an error due to attachment extension checking
Post by: CrescentEclipse on June 21, 2015, 03:09:13 PM
Hm interesting, I will look into it.