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

OnError event have a bad behavior with the showPreview option #1082

Closed
6 tasks done
BakasuraRCE opened this issue Sep 18, 2017 · 0 comments
Closed
6 tasks done

OnError event have a bad behavior with the showPreview option #1082

BakasuraRCE opened this issue Sep 18, 2017 · 0 comments

Comments

@BakasuraRCE
Copy link

BakasuraRCE commented Sep 18, 2017

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of bootstrap-fileinput.
  • This is not an usage question. I confirm having read the plugin documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

Steps to reproduce the issue

  1. Set showPreview to false
  2. Create an error event handler
  3. Upload any file
  4. Return an invalid response in the server
  5. The error happend

Expected behavior and actual behavior

The variable $thumb is not defined when showPreview are disabled:

self._setPreviewError($thumb, i, self.filestack[i], self.retryErrorUploads);

Other events have a checker about it:

if (self.showPreview) {

fileinput.js:3017 Uncaught TypeError: Cannot read property 'find' of undefined
    at FileInput._refreshUploadButton (fileinput.js:3017)
    at FileInput._setPreviewError (fileinput.js:3014)
    at fileinput.js:2146

image

@BakasuraRCE BakasuraRCE changed the title OnError event have a bad behavior with the thumbs OnError event have a bad behavior with the showPreview option Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants