Problem/Motivation

Drupal core's version of jQuery Form Plugin is out of date and restricts developers from using new features that browsers supports for file uploads for example.

Proposed resolution

Comments

andypost’s picture

attiks’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D7

I just ran into an issue (#1669960: Clientside Validation 1.33 fails on IE) with clientside_validation on D7, to support some functionality we added new 'methods' to javascript Array (Array.prototype.indexOf, Array.prototype.lastIndexOf) for IE < 9

The problem is that the current jquery.form.js version cannot handle this and IE < 9 users are getting a cryptic error message, so we need to backport this to Drupal 7 as well, pretty please.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

JS crashes before sending anything for me on FF.

attiks’s picture

@nod_ care to share some more info: page, browser version, ...

Can you test on http://testswarmcv.h001.attiks.com/node/add/article it contains an override of jquery.form.js and works in FF13

nod_’s picture

Yeah sorry, Tested your link:

works on Opera 12

on FF 13.0.1 (linux) I get after clicking on the upload button:

An error occurred while attempting to process /file/ajax/field_image/und/0/form-k5equgFLOuhEMmZMnW5SVZIn6hRxiYaXoC5uFMXrSNk: Component returned failure code: 0x80460001 (NS_ERROR_CANNOT_CONVERT_DATA) [nsIDOMFormData.append]

Don't really have time to dig into it ATM. Can test/review though :)

attiks’s picture

@nod_ known problem, see #1575060: ajax_html_ids are broken for forms with file element (encoding=multipart/form-data)

Possible fix in jquery.form.js, fixing FF problem but untested:

                    if (typeof options.extraData[p] !== 'object') // <-- added, fails on html_ids[]
                        formdata.append(p, options.extraData[p]);
attiks’s picture

attiks’s picture

FYI: I committed the fix to clientside_validation on it's working in FF, see http://drupalcode.org/project/clientside_validation.git/commit/481c9e6 and http://testswarmcv.h001.attiks.com/node/add/article

nod_’s picture

Nice :) thanks for the follow up upstream.

attiks’s picture

#7 got committed upstream and is included in the latest version at http://malsup.github.com/jquery.form.js

Patch needs to be rerolled

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new70.46 KB

D7 backport of #1575060: ajax_html_ids are broken for forms with file element (encoding=multipart/form-data) commited so here's a re-roll for current version

Status: Needs review » Needs work

The last submitted patch, 1574560-jquery.form_.js-11.patch, failed testing.

andypost’s picture

Issue tags: +revisit before beta

We should close #1575060: ajax_html_ids are broken for forms with file element (encoding=multipart/form-data) and revisit the issue before release to make sure we are using latest version

andypost’s picture

current version is 3.39.0-2013.07.31

andypost’s picture

Issue tags: +revisit before beta

taggin

andypost’s picture

Status: Needs work » Needs review
nod_’s picture

Status: Needs review » Reviewed & tested by the community

That works, thanks :)

webchick’s picture

Status: Reviewed & tested by the community » Needs review

Can someone give details on what they manually tested with this patch?

nod_’s picture

Status: Needs review » Reviewed & tested by the community

Tested:

  • uploading an image in node/add/article
  • 'add more' button
  • quickedit
  • Views UI
  • ajax exposed filter on a view (that would have worked if it wasn't telling me that the ajax callback URL /views/ajax is 404)

and that's pretty much everywhere the library is used.

webchick’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Awesome, thanks!

Committed and pushed to 8.x.

Marking for backport to D7, but that'd be David's call.

mustanggb’s picture

Issue summary: View changes
Issue tags: -revisit before beta

Patch is in D8, untagging.

andypost’s picture

Assigned: Unassigned » David_Rothstein
Issue tags: +revisit before beta

Once patch is in 8.x I still not sure it's ok for 7.x to upgrade shipped library, there's https://drupal.org/project/jquery_form_update for that
Anyway this library should be updated to the latest release of 8.x

David_Rothstein’s picture

Assigned: David_Rothstein » Unassigned

Right, isn't that what https://drupal.org/project/jquery_update is for?

To update this in core, we would basically need to pore over the release notes and also do a line-by-line code review to make sure there are no API changes. Because we don't really know how contrib modules are using the library. I am not volunteering for that line-by-line review :)

Also, http://malsup.com/jquery/form/#faq suggests that the latest version isn't even compatible with the version of jQuery that ships with Drupal 7 core...

mustanggb’s picture

Version: 7.x-dev » 8.x-dev
Status: Patch (to be ported) » Postponed

Okay so in 7.x we're leaving this to contrib.

Postponing because this issue isn't blocking anything so to avoid wasting time we can just grab and test the latest version nearer to release.

catch’s picture

Priority: Normal » Major
Status: Postponed » Active
Issue tags: -Needs backport to D7, -revisit before beta +beta target

3.50 now.

andypost’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new15.74 KB

new version, and it seems there's no more dependency on 'jquery.cookie'

nod_’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -mobile, -jQuery UI, -Needs manual testing

Tested things from #19, everything still works.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

No longer applies.

rajendar reddy’s picture

Status: Needs work » Needs review
StatusFileSize
new15.74 KB

Updating patch with reroll. Please review.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

back to rtbc

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

  • Commit c395981 on 8.x by catch:
    Issue #1574560 by andypost, Rajendar Reddy: Update jQuery Form Plugin to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.