Comments

Andrew Gorokhovets’s picture

subscribe

swim’s picture

Hmm, I got this working a few weeks ago (although my situation was very ad hoc) it was fairly simple. I'll throw a patch together tonight.

I think it's related to; classes over id's.

swim’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

Ahh apparently we need both now. Unless I'm being stupid.

['#attributes']['id']
['#id']

Working patch attached.

swim’s picture

Issue summary: View changes

spelling

petabyte’s picture

See status change message.

petabyte’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Did a review and can confirm that this patch fixes the compatibility issue for Webform Ajax 7.x-1.x-dev (from Oct, 26th 2013) and Webform 7.x-4.0-beta1. Thanks hapax!

Derimagia’s picture

Looks like the reason the id change was necessary is because of webforms's pre_render function 'webform_pre_render_remove_id' which removes the #id.

ekidman’s picture

Thanks for the patch. However, after the patch is applied, I get a message that states:

"An error occurred while attempting to process /system/ajax: Object [object Object] has no method 'ajaxSubmit'" (Chrome)

"An error occurred while attempting to process /system/ajax: ajax.form.ajaxSubmit is not a function" (Firefox)

I'm also loading the webform in a Colorbox via Colorbox_Node. Not sure if this relates to Webform AJAX at all, but hopefully someone has some insight.

Webform 7.x-4.0-beta1
Webform AJAX 7.x-1.1

swim’s picture

@ #7 it sounds like you need to include the Ajax library...

ekidman’s picture

Good call, that fixed it. Thanks.

marcusx’s picture

Can confirm that this makes the ajax working with webforms 4.x.

karlshea’s picture

Confirm this works with Webform 4.x in a block inside a panel

Daemon_Byte’s picture

Has anyone got this working for multi-step?

miro_dietiker’s picture

Hint: I have added maintainer access for swim and drastik on behalf of their request.
I hope they find time to take care of this issue.

swim’s picture

Assigned: Unassigned » swim
Related issues: +#2150381: Ajax submit does not work, +#2196417: Ajax doen't work

Thanks Miro,

I'll roll a new dev release ASAP (tonight hopefully). This issue might span to multistep webforms although I didn't encounter any problems with this feature.

  • Commit c2db39e on 7.x-1.x by swim:
    Issue #2102029 by swim: Webform 4.x support.
    
eternallight’s picture

Guys, thank you for the working patch but unfortunately it has caused another issue. After applying, Clientside Validation Webform stopped working on submit. Could you please consider the compatibility with this module in the further releases?

Solution found:
Enable the Validate before AJAX call option in the settings of the specific webform's Client Validation. Sorry for disturbing.

abacaba’s picture

StatusFileSize
new863 bytes

Hi guys, I have done that if you apply a patch to correct this comment creates html button code automatically https://www.drupal.org/node/2102029#comment-8010383

rajab natshah’s picture

Hi,

I'm not sure if this issue will be patched in the next version.

Rewarded :)

garethhallnz’s picture

I have 7.x-1.1 installed and the committed patch form #15 does not work. The form submits.

Patch #17 . Specifically

unset($form['actions'][$button]['#pre_render']);

fixed the issue.

torotil’s picture

StatusFileSize
new898 bytes

I can't reproduce #1548610: Ajax-webform in block ajaxifies other forms on that page after validation at all with the current Drupal 7.50 / webform 4.x. This might be due to changes in Drupal-core especially the ajax_html_ids data-structure that is used to seed drupal_html_id() on each AJAX request.

Unless someone else can still reproduce the core-issue I'd vote for removing the workaround instead of fixing it for webform4.

hkirsman’s picture

Doesn't work for me. Tried dev version and different alterations stated here. Id doesn't seem to matter. Downgrading Webform back to 3.

hkirsman’s picture

StatusFileSize
new22.24 KB

Here's the button source code.

torotil’s picture

I’m using the patch from #20 since more than 2 years on several sites now. It works for me.

torotil’s picture

Status: Reviewed & tested by the community » Needs review

  • torotil committed c9c25d1 on 7.x-2.x
    Issue #2102029: Remove Drupal core workaround.
    

  • torotil committed 9a01d23 on 7.x-2.x
    Issue #2102029: Bump webform dependency to >=4.4.
    
torotil’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Fixed

I have committed #20 to the new 7.x-2.x branch (webform4 only).

It seems the underlying issue described in #6 was fixed in #2438363: Need to add check for ajax in webform_pre_render_remove_id which was released as part of webform-7.x-4.4. I’ve also bumped the webform dependency accordingly.

Status: Fixed » Closed (fixed)

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