Hey LouBabe and all,

I just wanted to check in and see if a Drupal 7 port of the Mailchimp module was in the works. Most of our development work is shifting to D7 within the next couple months and we love using this module. It would be great to see a port sometime in the not-so-distant future....

Cheers,
Ben

Comments

BenK’s picture

Now that the D7 beta release is right around the corner (scheduled for May 21), I thought I'd check in again to see if there is any interest from the maintainers in a Mailchimp module D7 release... I'd be willing to help, but just want to know what plans are first.

Thanks,
Ben

levelos’s picture

Most definitely. Just been busy improving the 6.x version still (among other things!), but very much welcome any help in the port.

BenK’s picture

Status: Needs review » Active
StatusFileSize
new3.63 KB
new38.18 KB

Hey Lev (loubabe),

Great to meet you and chat over the last few weeks. As I mentioned, Jon Duell (duellj) and I had a chance to run Mailchimp through the Coder Upgrade module at the Portland "Brewpal" meetup yesterday. And the good news is that the combination of Coder Upgrade and a some manual debug work resulted in a preliminary Drupal 7 port of Mailchimp that installs in Drupal 7, interfaces with the Mailchimp API, and can subscribe a user to a Mailchimp list via the user edit page.

Note that we based the port on the 6.x-2.0-rc5 version of the Mailchimp module.

To document what we've done, I've attached to this comment:

1. The resulting mailchimp.patch file that Coder Upgrade gave us. (We applied this to create the D7 port.)
2. The Coder Upgrade log file that gives a general summary of the changes made by the Coder Upgrade module.

In a subsequent comment, I'll upload our current D7 version of Mailchimp that includes the additional manual changes Jon made to get the module (somewhat) working. I'll also document the things we did, what seems to work, and what doesn't.

Cheers,
Ben

BenK’s picture

Category: support » task
Status: Active » Needs review
StatusFileSize
new38.46 KB

Hey Lev (loubabe),

I've attached to this comment the latest version of our D7 Mailchimp port. Note that we based the port on the Mailchimp 6.x-2.0-rc5.

After applying the patch file created by the Coder Upgrade module (see Comment #3), Jon made the following manual changes:

1. db_query changes weren't picked up by Coder Upgrade (the Coder Upgrade patch for this is in progress). Jon ran the in-progress Coder Upgrade patch and it fixed some db_query issues... but not all of them. The rest he changed by hand.

2. Coder upgrade mistakenly changed user_load to user_load_multiple. Jon reverted this back (and filed a bug report to Coder Upgrade).

3. Some complex logic in hook_user couldn't be split up by coder upgrade. Jon split this up by hand.

4. Fixed some key exist notices (some were possibly related to PHP 5.3).

5. I added a line to the .info file (configure = admin/config/mailchimp) so that a link to Mailchimp's configuration page is added to Drupal's modules overview page. This is a new feature for D7 (see http://drupal.org/node/542202).

NOTE: On Mailchimp's configuration page (admin/config/mailchimp), there are lots of notices before saving the configuration form (mostly related to accessing a property on a non-object). Once you save the configuration form for the first time, however, then the notices go away. But there are probably some small bug fixes that need to be done to mailchimp.module to get rid of these notices without having to save first.

2ND NOTE: Mailchimp's configuration page isn't showing up in D7's configuration menu and I wasn't sure how to fix this. So to get to Mailchimp's configuration page, you either need to type in the address manually (admin/config/mailchimp) or else click the link on the modules configuration page (admin/modules) in the "Operations" column.

So here's what has been tested to work:

* Using the user edit page (user/[uid]/mailchimp), we were able to successfully subscribe a user to a Mailchimp list.
* Using the user edit page, we were able to unsubscribe a user from a Mailchimp list.
* Using the user edit page, we were able to add or remove a user from various interest groups.
* Subscribe and unsubscribe the current user via the Newsletter Subscription page (mailchimp/subscribe)
* We were also able to successfully merge e-mail, first name, and last name with Mailchimp (although we merged system fields like username and e-mail, not profile fields).

Here's what doesn't yet work:

* Subscribing users via cron (there's an error message)
* Subscribing users via the initial user registration form (there's an weird "save settings" button and an error message)
* Blocks supplied by Mailchimp aren't appearing at all on the block UI admin page.

So Lev, can you take a look at the attached D7 Mailchimp module and see what you think? How much cleanup do you think needs to be done before we can at least create an initial D7 branch?

Hope all is well,
Ben

levelos’s picture

Status: Active » Needs review

Hey guys - Baseline D7 port committed and I created a dev release, http://drupal.org/node/854388. As a reference and starting point for the discussion tonight, I did find a number of pretty big problems, all in all spending about 3 hours to move from http://drupal.org/node/705876#comment-3124522 to the committed code. Some serious formatting issues in splitting up hook_user, funky code in the block implementations, etc. But all in all, a great job and hopefully we have a solid starting point for a stable D7 release.

hanoii’s picture

I would suggest to create the branch from HEAD rather than from the DRUPAL-6--1 branch, in order to avoid those exponential revision numbers such as currently: 1.2.2.1.2.3.2.8.2.62.2.1. To do that, you have to first merge all the latest DRUPAL-6--1 changes into head, commit head, and then branch.

I noticed this already on the DRUPAL-6 branch but as you are starting a new one maybe worth doing so this way?

From: http://drupal.org/node/93999#headbranch

Only sync changes to HEAD when you're going to start a new branch

Another viable approach to HEAD is to basically ignore it during most of your development, and only sync the changes back to HEAD when you're ready to create a new branch moving forward. In this case, you always create a branch for whatever release series you want to work on and do most of your work directly in that branch. When you're ready to create a new branch, you first copy the latest versions of the files from your most current branch back to HEAD. Then, you create a new branch from that point and carry on. This has a the nice benefit that you're always working in a branch that is named with exactly what version of the code it's for. By merging changes back into HEAD and branching from there, you prevent CVS's revision numbers from getting insanely long.

mlncn’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work
Issue tags: +dgd7

Do you think you'd be able to tag an alpha or beta release, or is the Drupal 7 branch not there yet?

levelos’s picture

I don't think it's there yet Benjamin. Further, I'll be working on a complete rewrite, likely in a 7.x-2.x branch in Q1 with support directly from MailChimp. Just something to keep in mind. The 6.x-2.x branch has also been significantly enhanced since the 7.x port was made, and we need to put in some effort to backporting those updates.

bocaj’s picture

"The 6.x-2.x branch has also been significantly enhanced since the 7.x port was made, and we need to put in some effort to backporting those updates.

I would really like to see progress made in porting to Drupal 7. At the company I work for we have just recently switched to Mailchimp for our email marketing services, which has prompted me to use this module.

I have submitted multiple patches, which I think are relevant and would like to see those committed in 6.x and then also included in the porting to Drupal 7.

I would be willing to assist in the porting, but I agree with loubabe's comment above that we need to get some of the more current updates into the Drupal 7 release.

jerry’s picture

Subscribing.

timhomewood’s picture

subscribe

branana’s picture

StatusFileSize
new1.87 KB

The D7 version still double serializes the mailchimp_lists variable. Here's a patch

pragnatek’s picture

subscribe

h0tw1r3’s picture

Status: Needs work » Needs review
StatusFileSize
new5.15 KB

Patch contains a complete fix (including update hook) for the double serialize bug.
Roll-up #1040360: undefined variable retVal in implode_recursive()
Fix #1032382: Trying to get property of non-object
Fix #1051814: Error when displaying signup block

Subscribing users via the initial user registration form (there's an weird "save settings" button and an error message) is also fixed.

houen’s picture

subscribe

hadsie’s picture

Category: task » bug
Status: Needs review » Reviewed & tested by the community

The fixall patch seems to be working quite well for me so far. Thanks @h0tw1r3! The only issue with it is that it must be applied from the folder above the mailchimp module folder. Generally the patch should be created within the module folder.

It would be great if we could get these rolled into the dev version of the module,

Cheers!
- Scott

hadsie’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new5.41 KB

Actually, I spoke too soon. It looks like the patch from #1040360: undefined variable retVal in implode_recursive() wasn't included. This patch is identical to #14 but with the patch for #1040360: undefined variable retVal in implode_recursive() as well.

marianicolosi’s picture

subscribe

regisfoucault’s picture

subscribe

h0tw1r3’s picture

StatusFileSize
new5.4 KB

Thanks hadsie for catching my mistake last time.
Attached is the latest roll-up.
Fix from #1071822: Does not allow you to subscribe to mailchimp mailing list with interest groups.
Work around for #1051814: Error when displaying signup block -- This is an interesting problem which occurs if you change the API key in drupal or remove a list in Mailchimp.

The 7.x branch is broken. Can we please get some of these patches committed? Most, if not all, are critical. I see that a rewrite is coming, but in the interim this is better than nothing.

levelos’s picture

Hey gang - Thanks for the patches and sorry for not committing sooner. I'll work on applying them ASAP post-DrupalCon. Also, as you've correctly noted, there's an exciting complete re-write taking place in 7.x-2.x. I've updated the project page with an overview of the module versions and where they're heading.

blackdog’s picture

StatusFileSize
new7.17 KB

Updated patch also fixes two PHP notices in mailchimp_block_view.

adshill’s picture

Any news on these being committed? Appreciate that there is a rewrite on the way but given this is being funded by Mailchimp, its a bit worrying that there still isn't a stable release for Drupal 7...

seanberto’s picture

Hi Adam,

While your concern is understandable, the development path for MailChimp in D7 isn't quite so clear cut. As of just the last few months, ThinkShout is on contract to maintain and further develop the integration opportunities between Drupal and MailChimp - as well as to help increase adoption of MailChimp in the Drupal ecosystem (through support, training, feature development, etc.). We are in close contact with the MailChimp team/management to understand their priorities. We also do our best to respond to the issues posted to this queue, as well as those issues and ideas brought to us by other organizations and developers interested in seeing these integration opportunities move forward. (Last week, for example, there was considerable discussion re: MailChimp/Drupal integrations at the National Nonprofit Technology Conference in Washington, DC.)

Keep in mind that this module was initially released 3 years ago for Drupal 5.x. Drupal, and more importantly the MailChimp API, have progressed considerably since then. There are a lot of new features within MailChimp that can't be integrated with a "port." Moreover, the difference between a rewrite and a port is not all that clear with the significant changes in Drupal's own API with the release of D7.

There are a number of D7 patches that we will address asap to help folks migrate to Drupal 7 sooner rather than later. Again, we're all doing our best (MailChimp as well as ThinkShout) to respond to all feature requests, support issues, etc., for the more than 3000 website maintainers leveraging this integration module.

Cheers,
Sean Larkin - Partner
ThinkShout.com

levelos’s picture

Hi Everyone - I (finally) applied the latest rolled up patch, [#705876-22: Drupal 7 port], http://drupalcode.org/project/mailchimp.git/commit/22659da. After committing a subsequent minor change, things appear to be running smoothly in my initial testing. Please review and we can get a tagged release out the door.

branana’s picture

On the latest dev build I'm getting "Recoverable fatal error: Object of class stdClass could not be converted to string in implode_recursive() (line 769 of /var/www/html/sites/all/modules/mailchimp/mailchimp.module)." on user login from /user

branana’s picture

Here's a patch to get around trying to implode objects in implode_recursive, it is against 7.x-1.x HEAD

adshill’s picture

Hi Sean,

Thanks for the detailed response, and apologies if my post seemed rather rude - I do appreciate the work that needs to go into modules of the importance of Mailchimp, more so with your update. If I was a developer I'd absolutely lend a hand. As it is now we have a patched up version working in D7 and that is a result, I think I was having a bad evening when I posted the above.

Again, appreciate the work and hope I can help in testing the next gen version.

seanberto’s picture

@Adshill, no worries at all. This is a geek forum, so direct communication is the norm. By those standards, your comment was downright cheery. ;)

Just an FYI that we're continuing to work on this port, as well as the rewrite. MailChimp has also asked us to begin work on integrating with their new STS API for transactional emails. Stay tuned! And to learn more, check out:

http://blog.mailchimp.com/mailchimp-launches-transactional-email-service...

The API documentation is here: http://apidocs.mailchimp.com/sts/1.0/

We'll be updating folks on the roadmap for this integration soon, but in short, it would mean that all outgoing email from your Drupal site could use MailChimp as the email gateway. MailChimp's new transactional email API provides analytics, so you'd be able to go into your Drupal site's backend to actually see the open rates on these emails. The options this opens for sweet features is pretty awesome.

Cheers,
Sean

levelos’s picture

levelos’s picture

Status: Needs review » Closed (fixed)

Closing this one out as an alpha release is on the way later today. Any subsequent issues should be in their own tickets.