2.2.3 breaks subscribing on registration

Created on 31 May 2024, 6 months ago
Updated 17 June 2024, 5 months ago

Problem/Motivation

2.2.2 works, 2.2.3 does not. With 2.2.3 a brand new user registering ends up triggering mailchimp_update_member() rather than mailchimp_subscribe(), which does not work because the user isn't subscribed yet.

Steps to reproduce

Install 2.2.3 Add a subscription field on the user entity that is checked during new user registration.

Current status

  • Provide details about what settings are selected on the field that causes this issue.
πŸ› Bug report
Status

Postponed: needs info

Version

2.2

Component

Lists Module

Created by

πŸ‡ΊπŸ‡ΈUnited States grasmash

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @grasmash
  • πŸ‡ΊπŸ‡ΈUnited States grasmash

    If I had to guess I'd say this broke it:
    https://git.drupalcode.org/project/mailchimp/-/compare/2.2.2...2.2.3?fro...

    The code seems to assume that if "allow_unsubscribe" is not present and true, then there must be no subscription happening. That's not true. Subscription can be mandatory.

  • Status changed to Postponed: needs info 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mariacha1

    Can you tell me a bit more about how you'd set up a subscription field to make it mandatory? What are your field settings?

    As due dilligence I tried out a variation of field settings like this:

    Required field: True
    Enable Interest Groups: True
    Hide Subscribe Checkbox for new subscribers: True
    Default value: Unset

    This created a field on the registration form that had a bunch of unchecked interests and showed no "Subscribe" checkbox.

    As long as I selected an interest, I was subscribed. If I didn't select any interests, I wasn't, which is the behavior I'd expect.

    I also tried out using the functionality that hides all the fields and then set a default value, like this:

    Required field: True
    Enable Interest Groups: True
    Hide Subscribe Checkbox for new subscribers: True
    Hide Interest Groups: True
    Default value:
    - Subscribe checkbox: True (and I tested Falseo here too)
    - Automatic interests: Red, Green

    I thought if the "Subscribe" checkbox was unchecked in the backend, perhaps the widget would not notice that some interests were set, but that seemed to subscribe people as well.

  • πŸ‡¦πŸ‡ΉAustria drupalfan2

    I have the same problem in v2.2.3 and dev version.
    Mailchimp subscription does not work anymore on user registration.

    I wrote the following patch to solve the problem.

    Feel free to optimize the patch or provide another solution.

  • πŸ‡ΊπŸ‡ΈUnited States mariacha1

    The patch supplied will try to subscribe (or unsubscribe) users to mailchimp not only when they make a change to their user account, but also any time the user entity (or whatever entity the field is on) is saved, including programmatically. This can lead to accidental unsubscribes.
    See https://www.drupal.org/project/mailchimp/issues/2775335 β†’ .

    I'm still looking for someone to provide more information about exactly what the field settings are, because although I do fully believe it's a problem, I haven't been able to reproduce it.

Production build 0.71.5 2024