JangoSteve / remotipart

Rails jQuery file uploads via standard Rails "remote: true" forms.
http://os.alfajango.com/remotipart
Other
1k stars 215 forks source link

jQuery3 compatibility #161

Closed spdawson closed 6 years ago

spdawson commented 8 years ago

Remotipart is causing a double PATCH request in my app, following upgrade to version 1.3.0. Similar to #129

One PATCH request contains all expected parameters, and has JavaScript format. The other PATCH has HTML format, and does not contain the attachment file parameter.

Furthermore, the spurious PATCH request does not contain the CSRF authenticity token, which is causing my application to terminate the user session as a security precaution.

I observe that if I revert commit 5366076cfd64fc00f937de13ad5fbe44dbff3262, then the problem goes away. I am using jQuery 3, which appears to have removed the complete method from the jqXHR object.

thomasstephane commented 8 years ago

Thanks @spdawson I have the same issue and your MR is addressing that well, anything blocking it to be merged in master?

blackham commented 8 years ago

+1 to the the error: $.rails.ajax(...).complete is not a function

Quick fix was dropping back to jquery2.

existent-ltd commented 8 years ago

+1, and dropping back to jQuery2 is not an option for our use case

fzingg commented 7 years ago

+1 Double Patch request with JQuery 3

howells commented 7 years ago

+1

jaybloke commented 7 years ago

+1

adis-io commented 7 years ago

+1

rodrei commented 7 years ago

I'm having the same issue here

penapono commented 7 years ago

+1

capjuancode commented 6 years ago

Same here,

<%= semantic_form_for([blah, blah], remote: true ) do |f| %>

The first Request is Controller#create as JS works but I have the same TypeError: Uncaught TypeError: $.rails.ajax(...).complete is not a function

Second Request Controller#create as HTML, because I don't have a handler for HTML 💥

and I can't downgrade jQuery3 :( .