Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropzone displaying error page html, not error #6328

Closed
sbulen opened this issue Nov 2, 2020 · 4 comments · Fixed by #6332
Closed

Dropzone displaying error page html, not error #6328

sbulen opened this issue Nov 2, 2020 · 4 comments · Fixed by #6332

Comments

@sbulen
Copy link
Contributor

sbulen commented Nov 2, 2020

Description

I think Dropzone may have an issue when a server-side error is encountered. Instead of displaying the error, it displays the html of the error page served up by the server...

Note, I cannot reproduce this. Sharing in case it looks familiar to someone?

Multiple threads from the support board:
https://www.simplemachines.org/community/index.php?topic=575402.0
https://www.simplemachines.org/community/index.php?topic=575434.0

This exact dropzone issue has been reported before - apparently if there is a server-side error reported this can happen. This thread shows how to trap the error instead of serving up the html:
https://stackoverflow.com/questions/39761736/dropzone-image-upload-error-display-how-to-remove-error

What you see instead (with console window open):
smfhelper-issue2

This is the error in the console:
smfhelper-issue3

If you click on the link in the console error, this is what you see:
smfhelper-issue

@sbulen
Copy link
Contributor Author

sbulen commented Nov 4, 2020

I have confirmed here that part of the problem is that current_board is undefined...

So, this new logic kicks in:
https://github.com/SimpleMachines/SMF2.1/pull/6301/files

As a result, the URL built to upload the attachment has no board on it, which, I think, is why there is a permissions error on the upload.

The js currently thinks it is being passed an error message to display. But since the problem is bigger & deeper, our fatal error form is presented. An entire page of html, which then gets embedded into the .js error message box where normally a message gets displayed...

@sbulen
Copy link
Contributor Author

sbulen commented Nov 4, 2020

I can reproduce this using the current GitHub code. Just add a regular user & have them try to upload a file.

I cannot reproduce this with RC3. This appears to be due a post-RC3 change.

@sbulen
Copy link
Contributor Author

sbulen commented Nov 4, 2020

Reverting this PR fixes it:
https://github.com/SimpleMachines/SMF2.1/pull/6301/files

@jdarwood007 - could you take a peek?

@smfbigguy
Copy link

smfbigguy commented Nov 4, 2020

Taking that code out worked perfect for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants