mailchimp_lists_load_email fails to find email address field when attached to a related entity.

Created on 1 March 2018, over 6 years ago
Updated 7 December 2023, 12 months ago

Hi, I ran into an issue where mailchimp_lists_load_email fails to load the email address when the email field is stored against a related entity.

For example, instead of applying Mailchimp Subscription field to the user profile directly, it's instead applied to an entity which references the user profile. I can configure/save this without any issues, but when I try and display the field an error occurs as the field cannot be found.

This seems to happen as the $mail_property variable contains a path to the referenced entity (eg 'uid:entity:mail') which can't be handled when calling $entity::get (on line 118 of mailchimp_lists.module).

My quick/dirty hack is to check if the property contains a colon character, and if so manually traverses the object graph (see attached patch), but I'm sure there's probably a better way to handle this.

Let me know if you need any further info.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Lists Module

Created by

🇬🇧United Kingdom JeremySkinner

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024