Hi guys,

First, thanks uc_mailchimp to integrate mailchimp and ubercart together.

I want to share my updated version and hope it may help to export new release.

1. I have tidied up the part of code format to make it easier to read.
2. Add interest groups feature
3. Have applied eojthebrave's patch (#1001750: Respect merge field settings from mailchimp.module)
4. Correct the display in check out review page (#1020986: Unclear subscription choice on "Review order" page)
5. Fix db_escape_string issue (#1218872: UC Mailchimp appears to be cause of error found here, mysql_real_escape_string() expects parameter 1 to be string)

This code is still need to be polished, but it works well in my instance.

Best regards, Eric

Comments

eric.chenchao’s picture

Forgot to mention that this version only support mailchimp module.

emmajane’s picture

Status: Needs review » Needs work

This version of the module yields the following error for me:
Fatal error: Call to undefined function _mailchimp_interest_groups_element() in /path/to/drupal-6.22/sites/all/modules/uc_mailchimp/uc_mailchimp.module on line 119

dsobon’s picture

How was "Fix db_escape_string issue" solved?

is it possible to split up all parts of the patch? It's hard to see what is what, and there is a real chance that it might introduce additional problems.

dsobon’s picture

Fix for "mysqli_real_escape_string() expects parameter 2 to be string, array given in db_escape_string()":

--- uc_mailchimp.module.orig	2009-12-17 01:00:00.000000000 +1100
+++ uc_mailchimp.module	2011-08-17 13:58:03.000000000 +1000
@@ -118,7 +118,7 @@
         return $review;
     break;
     case 'process':
-        $arg1->uc_mailchimp = $arg2;
+        $arg1->uc_mailchimp = serialize($arg2);
        
     break;
     case 'settings':
merzikain’s picture

A couple of minor issues that seem to have been overlooked.

In uc_mailchimp_action_ecom_update around line 477, you have the watchdog type set to uc_mailchimp_order which is longer than the 16 character limit for that field. That causes an error when attempting to log actions.

A few lines down from there you have rupal_set_message. Just missing the d.

zkrebs’s picture

subscribe - this just horrendously broke a site for me today :(

merzikain’s picture

I've been tweaking it for my needs all day, haven't had any real trouble though. What happened on your site?

zkrebs’s picture

I had to disable the module, because it made all orders go through with errors (and without shipping/billing details!). I looked in the logs to find the error, found this issue, and saw that the patch may work and may have a couple of errors in it. I have not applied it yet.

I suppose what I meant to say is: I'd like to use a patch and/or a module update that solved the problem and was verified to work.

javamandk’s picture

I had the same problem after upgrading Ubercart from 2.4 to 2.6, this solved the problem for me.

has anyone else tried this version?

/Javamandk

eric.chenchao’s picture

Status: Needs work » Needs review
StatusFileSize
new33.26 KB

An updates, try to fix mysql_real_escape_string.

eric.chenchao’s picture

StatusFileSize
new20.2 KB

Hi @merzikain (#comment 5) you are right, just fixes these two bugs.