After switching to the latest 7.x-3.0-alplha3 from 7.x-3.0-alplha2 I see that there is update of jQuery.form.js. What is different in jQuery.form.js v3? Problem is that after switching I have broken some AJAX callback called on form submit. I'm using this workaround:

PHP: 

$form['actions']['submit'] = array(
	'#type' => 'submit',
	'#ajax' => array(
		'callback' => 'webform_client_form_ajax_callback',
		'wrapper' => str_replace('_','-',$form['#form_id']),
		'effect' => 'fade',
	),
	'#value' => t('Submit'),
);

function webform_client_form_ajax_callback($form, &$form_state) {
	$form_errors = form_get_errors();
	drupal_get_messages();
	if ($form_errors) {
		$commands = array();

		$error = isset($form_errors['submitted][parameters][subdomain']) ? $form_errors['submitted][parameters][subdomain'] : null;
		$commands[] = array('command' => 'handleOrderAjaxForm', 'subdomainErrors' => $error, 'scroll' => true);
		$page = array('#type' => 'ajax', '#commands' => $commands);
		ajax_deliver($page);
	} else {
		return $form['#node']->webform['confirmation'];
	}
}



JS:

Drupal.ajax.prototype.commands.handleOrderAjaxForm = function(ajax, response) {
    alert('Hello');
};

and I have problem directly when I call ajax_deliver($page);. What's new or different? This technique which I'm using is described technique to call custom JS script on AJAX submit.

Note: before this update everything worked like a charm. My form is created using Webform module.

Comments

martinpesout created an issue. See original summary.

martinpesout’s picture

Issue summary: View changes
JakeWilund’s picture

I can confirm I'm experiencing the same issue after updating to 7.x-3.0-alpha3

martinpesout’s picture

Issue summary: View changes
William H. Olesen’s picture

This update seemingly screwed up Overlays for me somehow.

I can't Edit a node by clicking on the Edit-tab below the Title - the page fades down, but no overlay appears.

When trying to close my Content list in Overlay by clicking the X in the top-right corner, it doesn't close anything, but does supply another scrollbar (that's in Firefox).

I've done nothing else than the update (I initially tried to role back on the core-update I just did as well, but that changed nothing)

I tried switching between the different Jquery-versions (1.4 is/was Drupalcore), but that did nothing.

I am - to say the least - surprised that an update can do this to a core-module.

EDIT: It was fortunately no problem for me to go back to my latest backup before the Jquery-update, and without that everything works properly again.

I'm guessing we can expect a new update pretty soon?

criscom’s picture

I get a WSOD on /admin pages after updating to 7.x-3.0-alpha3. Reverting to 7.x-3.0-alpha2 didn't solve the problem.
Sorry, the WSOD on admin pages was related to updating to Drupal 7.41.

martinpesout’s picture

StatusFileSize
new69.35 KB

I did a test but my mentioned problem isn't related to Drupal 7.41. Is it any way how can I help you with fixing of this bug? I don't know what's new in jquery.form.js v3. I've set AJAX form handler as you can see in my example and after form Submit I'll see alert window. Screenshot is attached to this post (sorry, my environment is in Czech).

slown’s picture

Up, i have same issue as William H. Olesen #5

What's the problem?

Thank you!

markhalliwell’s picture

Version: 7.x-3.0-alpha3 » 7.x-3.x-dev
Status: Active » Postponed (maintainer needs more info)
Related issues: +#2266303: Update jquery.form.js, +#2156881: Support (optionally) the use of the jQuery Migrate Plugin

The form plugin itself shouldn't have changed much (except structurally to support jQuery 1.5+). It could be that there is an issue with later jQuery versions, try enabling the jQuery Migrate plugin. I will need more information (e.g. JS console errors, if any) to help pin point what the actual issue is.

#5 & #8 are entirely separate issues and have absolutely nothing related to this issue, see #2507857: Remove 1.9 replacement files and #2597774: Force/suggest using migrate plugin when bbq or overlay JS is detected using jQuery 1.9+.

martinpesout’s picture

I did a small investigation and found a solution.

As you can see in issue description, I'm using ajax_deliver($page); in my callback function. I've found that after switching to 7.x-3.0-alplha3 I need to remove ajax_deliver($page); and call return $page; instead.

Note: This call return $page; didn't work in 7.x-3.0-alplha2.

William H. Olesen’s picture

I just realised I've been a total ass concerning #5.

The problem is easily solved in the Jquery Update Configuration by selecting Default (Provided by Drupal) under "Alternate jQuery version for administrative pages".

Yeah, that was a real cracker and I'm an idiot :D

markhalliwell’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

This can be resolved by using the jQuery Migrate plugin as mentioned in #9.