Please use the 7.x-2.x branch of this Module for Webform 4.x

The 7.x-1.x won't introduce support for Webform 4.x. However, both branches should have the same features.

Orignal Issue:

The Webform 4.x was created some time ago. It would be nice to keep up with its development.
Following page describes the necessary changes: Upgrading from Webform 3.x to 4.x

The only change so far this module is affected of is The $submission->values variable structure changed.

Decision to make: I recommend to create dedicated branches of the module for 7.x-3.x and 7.x-4.x. I guess there will be other, more profound, changes in Webform 4.x branch which will make it harder to write backward compatible code. And maintaining a single branch for both versions could lead very quick to unmaintainable code.

However, I don't want and can't make a decision here :). Thus I've created two patches:

Mixed-Mode
Introduced a getter function which switches dynamically between the 3.x and 4.x data-structure. There's overhead but I don't think it's a show stopper.
Dedicated branches
Simply rewritten all $submission->data[$key]['value'][0] constructs.

Further both patches streamline the code to pass all the drupalcs sniffs.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blackdog’s picture

Hey Peter,

I've created a new branch and pushed it. I have also given you Git access, so if you feel up to maintaining the 7.x-2.x branch, please go ahead!
I have not committed the patch, I'll leave that up to you.

Thanks!

das-peter’s picture

Hey Hans,

thank you very much for your response and the git access.
Since we use the changes already in production without any problems, I decided to patch the 7.x-2.x.
Commit: http://drupalcode.org/project/webform_mailchimp.git/commit/5a5e09d

Cheers
Peter

Anonymous’s picture

Just applied this patch. Works great but fails when updating .info file:

patching file webform_mailchimp.info
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file webform_mailchimp.info.rej

S

areikiera’s picture

Would be awesome to extend this module's compatibility with Webform 4.x by making the MailChimp field available in the 'If' field in the conditionals. Would love to show groups only when the MailChimp field is checked.

ptmkenny’s picture

Greetings Peter,

If I want to use Webform Mailchimp with Webform 4 now, should I apply the patch or check out one of the git branches? I tried to checkout the 2.x-dev branch with git (in reference to #2) but drush couldn't find the branch.

ptmkenny’s picture

I re-rolled the webform_mailchimp-only-4.x-compatible.patch so that the hunk error described in #3 no longer occurs. Also, I updated the old default e-mail syntax (%useremail) to the 4.x syntax ([current-user:mail]).

Note: I'm relatively new to Drupal patching, so I created this with diff, not git. Let me know if I'm doing it wrong.

das-peter’s picture

@ptmkenny Thanks fr re-rolling the patch. As far as I know only git patches are "supported" by the whole drupal.org environment - so it would be great if you could re-create it with git. If you need direction how to do this please have a look at Novice contributing 3: Create a patch or Making a Drupal patch with Git

Let's hope the actions here will bring the attention of the module maintainer so this goes into the official version soon :)

ptmkenny’s picture

Ok, here's my attempt at a reroll in git.

das-peter’s picture

Looks like a proper git patch :) Let's hope the issue gets some attention now.

ptmkenny’s picture

Title: Webform 4.x compatibility. » Webform 4.x compatibility
FileSize
1.14 KB

Please disregard patches #6 and #8. It looks like the webform_mailchimp-only-4.x-compatible.patch in the original post was already committed to the 2.x branch of this module. So, there is no need to reroll the patch. This is for the 2.x branch of the module.

(I assume 1.x = webform 3 and 2.x = webform 4)

Instead, e-mail token support needs to be updated, so I am attaching a patch that just adds e-mail token support for 4.x.

BenK’s picture

Status: Needs review » Needs work

I've tested out the patch in #10 to update e-mail tokens, but subscription to Mailchimp is not working if the user is an anonymous user. (Everything seems to work fine if the user is logged in.) I looked at the code, but not sure what is causing this problem. Ideas?

--Ben

das-peter’s picture

Meanwhile I realized I got some management permissions to this module - man I'm getting old, forgetting where I've which permissions already ;).
I created a 7.x-2.x-dev release, because that's indeed the branch that's compatible to Webform 4.x.
But I don't think there will be Webform 4.x compatibility in the 7.x-1.x branch.
Unfortunately I don't have the permission to edit the project page to document which branch has to be used for which Webform version.
Maybe I can ask blackdog for the permission.

It would be great of you Webform 4.x guys :D if you could test the 7.x-2.x-dev release and let me know if it works for you too. If so I'd say I'll create at least a proper beta release.

das-peter’s picture

Status: Needs work » Needs review

Awesome, Hans already gave me the permission to edit the project page. I've added the required information and now we just need feedback if you guy's are happy with the 2.x branch to create a proper rc version.
Thus I set this to "needs review".

BenK’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

@das-peter: Thanks great news you've been able to update the project page and make a 7.x-2.x-dev branch.

Did you see the patch posted in #10 and my comments in #11?

Basically, the patch in #10 is required to make email addresses compatible with Webform 4.x, but the patch isn't fully working properly. It works great for authenticated users, but doesn't seem to work for anonymous users (the user is not being passed to Mailchimp).

Can you review the patch and see if there's a quick fix?

Thanks,
Ben

P.S. ptmkenny: I'd be interested to know if you have an idea for the anonymous user issue, too.

David Frohmader’s picture

We also have need for the anonymous user issue to be fixed. Is anyone looking at this? Will it be fixed anytime soon? Without this ability we cannot increase our MailChimp subscribers other than manually. Ugh!

das-peter’s picture

Status: Needs review » Fixed

I've realized (again) that I've commit permission ;) , so here we go: Committed and pushed #10: http://drupalcode.org/project/webform_mailchimp.git/commit/1f55e157b1e79...

Thanks for the patch!

And since I seem to have the permission to create releases too I've created a first beta release: https://drupal.org/node/2091019

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added information about which branch to use with which Webform version.

amiller86’s picture

I am currently using webform mailchimp 7.x-2.0-beta1 and webform 7.x-4.0-rc3 and this issue does not appear to be resolved.

Any webform that I set with the mailchimp subscription box will not send the subscription to mailchimp and fails to load the destination url.

Please provide support on this issue.

amiller86’s picture

Status: Closed (fixed) » Active
das-peter’s picture

Status: Active » Postponed (maintainer needs more info)

Any webform that I set with the mailchimp subscription box will not send the subscription to mailchimp and fails to load the destination url.

Please provide sufficient information on the issue. Providing support based on this information is almost impossible.

amiller86’s picture

Well sadly I think I found the issue so this is probably I different issue than I thought. They recently released version 7.3.1 of the mailchimp module, and that seems to be what is causing the problem as all the other sites I have worked on are working fine with webform mailchimp 7.x-2.0-beta1 and webform 7.x-4.0-rc3.

Is there any plan to update webform mailchimp to handle Mailchimp 7.3.1?

adam_b’s picture

davidsickmiller’s picture

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

This was reopened for an unrelated issue; re-closing.