apostrophe icon indicating copy to clipboard operation
apostrophe copied to clipboard

Replacing an image in the create modal isn't working.

Open jth- opened this issue 10 years ago • 5 comments

jth- avatar Mar 18 '16 15:03 jth-

The bug only occurs immediately after a "New Image" upload. Replacing the source file of an existing image works.

mcoppola avatar Apr 07 '16 18:04 mcoppola

I spend ~30 minutes on this today and had no luck. I tried reseting the input value to null, and also removing all existing data before invoking $input.fileupload again. I also tried unbinding and rebinding the listeners. I never see the $.fileupload's start method fire after the first time.

I'll be able to prioritize it again after a meeting tomorrow morning.

mcoppola avatar May 24 '16 20:05 mcoppola

Got a hunch. Peeking.

On Tue, May 24, 2016 at 5:04 PM, Matthew Coppola [email protected] wrote:

I spend ~30 minutes on this today and had no luck. I tried reseting the input value to null, and also removing all existing data before invoking $input.fileupload again. I also tried unbinding and rebinding the listeners. I never see the $.fileupload's start method fire after the first time.

I'll be able to prioritize it again after a meeting tomorrow morning.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/punkave/apostrophe/issues/463#issuecomment-221391919

*THOMAS BOUTELL, *DEV & OPS P'UNK AVENUE | (215) 755-1330 | punkave.com

boutell avatar May 25 '16 13:05 boutell

This is fixed, please review #564

For reasons having to do with fallback support for IE9 and other browsers that don't support the new file upload APIs, jquery fileupload replaces the input element with a new clone each time. This breaks our code for clicking the true file input button when our more aesthetically pleasing fake button is clicked. More precisely, our code clicks the old input element, which is still in the world but no longer hooked up to any plumbing. Solved by always finding it anew from the fieldset in the click handler.

boutell avatar May 25 '16 13:05 boutell

Merged PR, closing!

jth- avatar May 25 '16 13:05 jth-