Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Core 6.16
I have a function, in a custom module, that binds ahah links like so:
public function bind_ahah_link( $url, $selector, $wrapper, $link, $effect, $title = false ){
$ahah_binding = array(
'url' => url($url),
'event' => 'click',
'wrapper' => $wrapper,
'selector' => '#'.$selector,
'effect' => $effect,
'method' => 'replace',
'progress' => array('type' => 'throbber')
);
drupal_add_js('misc/ahah.js');
drupal_add_js('misc/jquery.form.js');
drupal_add_js(array('ahah' => array($selector => $ahah_binding)), 'setting');
$render = l( $link, '#', array ( 'attributes' => array( id => $selector, 'title' => $title ) ) );
return $render;
}
This works great for me -- until I install jQuery Update. At that point the binding simply stop functioning.
Firebug reports no js errors and all the required js files are included. I have disabled every other jQuery module and the issue persists.
When I disable jQuery Update, my bindings function again -- BUT if I call the updated jquery.form.js directly (rather than letting the module do it) like so:
drupal_add_js('misc/ahah.js');
// drupal_add_js('misc/jquery.form.js');
// drupal_add_js('sites/all/modules/jquery_update/replace/ahah.js');
drupal_add_js('sites/all/modules/jquery_update/replace/jquery.form.js');
... I'm back to the same problem...
Any thoughts? Is this a silly way to bind my links anyway?
Comments
Comment #1
oc666 CreditAttribution: oc666 commentedconfirm this bug. jquery_update-6.x-2.x-dev break ahah and simple uses are not implement at all. Example of one that doesn't work (from form api):
$form['choice_wrapper']['poll_more'] = array(
'#type' => 'submit',
'#value' => t('More choices'),
'#description' => t("If the amount of boxes above isn't enough, click here to add more choices."),
'#weight' => 1,
'#submit' => array('poll_more_choices_submit'), // If no javascript action.
'#ahah' => array(
'path' => 'poll/js',
'wrapper' => 'poll-choices',
'method' => 'replace',
'effect' => 'fade',
),
Comment #2
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedI confirm as well. Here is a ahah link which does not work with jquery_update-6.x-2.0-aplha1:
Comment #3
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedI think if someone is about to fixe this, he should have a look at how quicktabs implemented the ahah and form fixing.
http://drupal.org/project/quicktabs
Comment #4
Equinger CreditAttribution: Equinger commentedsubscribe.
Comment #5
Equinger CreditAttribution: Equinger commentedI can confirm that commenting that file out in the module is necessary AND sufficient to solving this ahah problem.
Comment #6
Equinger CreditAttribution: Equinger commentedI also can confirm that the very latest version of this jquery forms plugin here: http://jquery.malsup.com/form/#download does not work either
Comment #7
smoothify CreditAttribution: smoothify commentedNot sure if its an exact duplicate, but this issue is very similar, and contains a fix.
#806500: jQuery update breaks AHAH form when there is a file input (file upload) in the form
Comment #8
kiploona CreditAttribution: kiploona commentedConfirm.
Excluding 'jquery.form.js' solves a problem.
BTW, in safari .js console i found an error, when tried to change AHAH dropdown element:
TypeError: Result of expression '(jQuery(this).data('form-plugin-onload'))' [undefined] is not a function.
Firefox keep it silent. So, maybe, this info will help developers to solve tis bug...
Comment #9
NiklasBr CreditAttribution: NiklasBr commentedI don't know if there is any use commenting on this old issue, but I just want to say that I hit upon it today with Drupal 6.28.
Comment #10
markhalliwellDrupal 6 reached EOL (end-of-life) on February 24, 2016.