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

multiple file uploads appending results to wrong file upload after all file uploads are filled in frontend form #296

Closed
shivgre opened this issue Apr 21, 2015 · 1 comment

Comments

@shivgre
Copy link

shivgre commented Apr 21, 2015

There is a bug in the cmb.js file for file_list file input which after all file or file_lists have been selected and then if user reselect some more files in file_list or file inputs then the result is appended in wrong file input.
I found the fix.
It was the wrong selector object used. Please correct it for others.
In cmb2.js inside cmb.mediaHandlers.list function change the selector for appending the result from :

    $formfield.siblings('.cmb2-media-status').slideDown().append(this);

to :

    jQuery('#'+cmb.formfield).siblings('.cmb2-media-status').slideDown().append(this);

at line number 232.
Hope that helps the plugin developer and community, wasted 2 days to fix this bug.

@shivgre shivgre changed the title multiple file uploads appending results to wrong file upload after all file uploads are filled multiple file uploads appending results to wrong file upload after all file uploads are filled in frontend form Apr 21, 2015
augustuswm added a commit to augustuswm/CMB2 that referenced this issue Jul 9, 2015
cmb.mediaHandlers.* are redefined on the first click of each “file” or
“file_list” on the page. Each time .list and .single are redefined the
local variables for the current “file” and “file_list” are closed over.
This breaks the handlers for any previously clicked “files” and
“file_lists”. Variables have been moved into the handlers themselves
rather than rewriting the handlers.

In reference to :CMB2#250,
CMB2#296
@jtsternberg
Copy link
Member

This should be good on trunk. Feel free to test.

@tw2113 tw2113 closed this as completed Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants