Closed (fixed)
Project:
Mailchimp
Version:
2.0.2
Component:
Lists Module
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
4 Sep 2021 at 14:02 UTC
Updated:
11 Dec 2023 at 15:45 UTC
Jump to comment: Most recent
When subscription field is added to user entity and upon checking the subscription field and saving the user, it updates the database correctly (creates new row for the "field__subscription") but it never shows that to user. The field is always unchecked.
Install the module from composer, enable all Mailchimp sub module. Add new field "subscription" type to user entity and try to saving the field for any registred user.
Show the field is checked.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
guido_sI've got the same problem. I set up a webhook and so on, but the checkbox which I added to the user account fields is always unchecked.
Sign up for the newsletter works with this checkbox, but it doesn't represent the current status and doesn't give you the possibility to unsubscribe.
But the Mailchimp Lists module documentation says it should be capable of this https://www.drupal.org/docs/contributed-modules/mailchimp/mailchimp-lists
Comment #3
rob230 commentedI think this could be related? I'm having the problem that everyone is now being unsubscribed after updating the module. I don't know what has changed, but in the database the value for
field_name_subscribewas 0 for every single row, and these are people that are subscribed in Mailchimp.It seems that previously that's how it used to work. The only entries that have 1 are new subscriptions created after updating the module, the old ones going back years are all 0.
What's happening now when the user entity is saved (even by the system rather than the user using a form) is the following.
In
MailchimpListsSubscription::postSave()(which fires every time an entity is saved that has a subscription field on it):$choices always contains $choices['subscribe'] = 0, particularly if this save has come from cron or a hook rather than from the form.
In
mailchimp_lists_process_subscribe_form_choices():$choices['subscribe'] is always 0, so people are being unsubscribed.
This is a very major issue, we are losing thousands of subscribers per day!
I could set the value of every field_name_subscribe to 1 in the database, but I don't know if they have actually subscribed or not. I don't know what to do. It seems like the historical data doesn't match what the module now expects to be there which is causing everybody to be unsubscribed.
Comment #4
xenophyle commentedComment #7
xenophyle commented