When using mailchimp 2.12 I get the following, when trying to edit the pane: /admin/commerce/config/checkout/form/pane/commerce_mailchimp

Fatal error: Call to undefined function mailchimp_lists_load_multiple_by_name() in /data/disk/o1/static/panopolicious-build-20130821/sites/all/modules/contrib/commerce_mailchimp/includes/commerce_mailchimp.checkout_pane.inc on line 14

Comments

lsolesen’s picture

Seems to be because there is a missing dependency on mailchimp_lists

dydave’s picture

Hi Lars,

Thanks a lot for reporting this issue and posting a quick tip about why this issue would happen (and how it could be bypassed/fixed).

I encountered the exact same problem, did a quick search ended up on this post and .... indeed, the error was gone after I enabled the mailchimp_lists module.
I would also agree that a dependency to mailchimp_lists would be needed and just in case it could help anybody else or could be considered by maintainers, I went ahead and created a quick patch for that.

Please find attached to this comment a patch against commerce_mailchimp-7.x-1.x at e0a57df, which adds a dependency to the mailchimp_lists module to prevent the fatal error: Call to undefined function mailchimp_lists_load_multiple_by_name.
File attached as: commerce_mailchimp-undefined-function-mailchimp_lists_load_multiple_by_name-2075931-2.patch.
It is surely a very small patch, but at least it could prevent users from having a bad surprise with a fatal error, when module is already not that intuitive to configure....

I would greatly appreciate to have your testing/reporting, reviews, feedbacks, comments, objections, questions, issues or concerns on the attached patch.
Please let me know if for any reason you would think it would be more appropriate to go through a form_alter, merging the forms, instead of two pages, I would be glad to re-roll and come up with an updated version.

Feel free to let me know if you would have any questions, comments or suggestions about the code, patch, suggested approach or any other aspects discussed in this ticket, I would be very happy to explain in more details.

Thanks in advance to everyone for your testing, reporting, reviews, comments and feedbacks.
Cheers!

silkogelman’s picture

Status: Needs review » Reviewed & tested by the community

Tested, works as described.
This definitely makes the module more user friendly.
Thanks!

@hibersh Can you commit this please?

pwsherman’s picture

Issue summary: View changes

I applied the patch, but I'm still getting the error. I get a similar error when I try to uninstall the module data. addressfield_token and Lists are installed and configured. Restored database to pre-installation state multiple times to try to get it to work. Don't know what else to try. Any ideas what to check?

dydave’s picture

Hi @pwsherman,

Could you please specify the versions you're using?
For Drupal Core, Commerce Mailchimp, Commerce, MailChimp, Addressfield Tokens and any other related modules.

Could you please copy/paste in your comment the exact error messages you received? (also the ones from uninstall)

Screenshots could also help.

Thanks in advance.

pwsherman’s picture

Wow, thanks for answering. I'm not sure what to take a screenshot of, but I'm getting the same error when I click the configure link on the Subscription Options Checkout Pane.

Fatal error: Call to undefined function mailchimp_lists_load_multiple_by_name() in /home/sherman/public_html/watch1/sites/all/modules/commerce_mailchimp/includes/commerce_mailchimp.checkout_pane.inc on line 14

Versions:
Core: 7.32
Commerce MailChimp: 7.x-1.x-dev
MailChimp: 7.x-1.5
AddressField Tokens: 7.x-3.1

commerce_mailchimp.info:

name = Commerce MailChimp
description = Implements MailChimp Ecommerce API for use with Drupal Commerce.
package = Commerce (contrib)
dependencies[] = commerce_product
dependencies[] = commerce_order
dependencies[] = mailchimp
dependencies[] = mailchimp_lists
dependencies[] = addressfield_tokens
configure = admin/commerce/config/mailchimp
core = 7.x

; Information added by drupal.org packaging script on 2013-09-30
version = "7.x-1.x-dev"
core = "7.x"
project = "commerce_mailchimp"
datestamp = "1380560401"

Let me know if there is any other info I can provide. Thanks for your help!

pwsherman’s picture

I also tried setting the module weight in the system table so the commerce_mailchimp is heavier than _lists. Also upgraded to mailchimp 3.11. Neither eliminated the error.

I also noticed that the method mailchimp_lists_load_multiple_by_name() doesn't exist in either the mailchimp or the commerce_mailchimp modules.

More: the method does exist in mailchimp_lists/mailchimp_lists.entity.inc (7.2), which is not part of the latest release.

Found the answer here: https://www.drupal.org/node/2311181
commerce_mailchimp is incompatible with mailchimp 7.3 for this reason.

dydave’s picture

Great! Thanks @pwsherman for your clear and detailed replies.

Have you tried mailchimp-7.x-2.12?
Really not sure where you found "MailChimp: 7.x-1.5"... I couldn't find it in mailchimp's tagged releases...

It appears mailchimp-7.x-2.12 should have the function that causes the fatal error, see mailchimp_lists.module, line 1105.

Could you please try again with mailchimp-7.x-2.12? (Please make sure you have the patch applied when you test again)
Please make sure that this module is not overridden in another site's folder, such as default/modules or any other site that you would have potentially defined in your sites installation folder.

Thanks in advance.

anybody’s picture

+1 for a new version based on the patch above!

torgospizza’s picture

Status: Reviewed & tested by the community » Fixed

This change is in the current stable release of Commerce Mailchimp (1.0): http://cgit.drupalcode.org/commerce_mailchimp/tree/commerce_mailchimp.info

Marking as fixed!

Status: Fixed » Closed (fixed)

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