Closed (fixed)
Project:
Mailchimp
Version:
7.x-3.4
Component:
Lists
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2015 at 06:35 UTC
Updated:
4 Aug 2015 at 17:44 UTC
Jump to comment: Most recent
Currently mailchimp_lists_rules_action_entity_subscribe() uses $entity->raw() as parameter to call mailchimp_lists_process_subscribe_form_choices().
Unfortunately this can be the id of the entity and not the entity object.
Use $entity->value() this should always provide the unwrapped entity.
Reviews needed.
None.
None.
None.
| Comment | File | Size | Author |
|---|---|---|---|
| mailchimp-fix-rule-mailchimp_lists_rules_action_entity_subscribe.patch | 751 bytes | das-peter |
Comments
Comment #1
BabaYaga64 commentedFrom what I understand, it seems that $entity->raw() and $entity->value() both return correct entity object ids. The difference is that $entity->raw() provides the raw data, and $entity->value() provides the wrapped data. I haven't been able to reproduce this issue so that I can check to see if your patch works. Would it be possible for you to provide documentation for $entity->raw() returning the entity id and not the entity object id? Or perhaps suggest a way to reproduce the behavior you're describing?
Comment #2
das-peter commentedThanks for the feedback :)
Fired up my debugger again.
The only "special" thing in my case is, that I use an item list in rules.
This means that
entityis actually anEntityListWrapperitem, which seems to return the id when usingraw()and the object when usingvalue().However, my suggestion stands:
While
raw()seems to return "inconsistent" values,value()doesn't. And as of my experience and testsvalue()shouldn't return a wrapped entity, it might processes the output, e.g formatting a date when accessing a date field, but it doesn't wrap the data in an entity metadata wrapper.Test-Code:
Comment #3
BabaYaga64 commentedDas-Peter, I've applied and tested your patch, and it works! I'm waiting to push the changes to the mailchimp repo until I get clearance from my colleague. Thank you!
Comment #4
das-peter commented@BabaYaga64 Awesome, thanks :) I very much appreciate your fantastic reaction time!!
Comment #5
jami commentedPushed to 7.x-3.x.
http://drupalcode.org/project/mailchimp.git/commit/29419b0
Thanks for your work das-peter and BabaYaga64!