Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The default value is only respected when creating the entity trough a form. The patch ensures that the default value is also used with modules like restws, uif and feeds.
Comment | File | Size | Author |
---|---|---|---|
#14 | mailchimp_lists-defaults-value-2375183-15-D7.patch | 701 bytes | karel010 |
#1 | mailchimp_lists-defaults-value-2375183-1-D7.patch | 946 bytes | karel010 |
Comments
Comment #1
karel010 CreditAttribution: karel010 commentedComment #2
karel010 CreditAttribution: karel010 commentedComment #6
ruscoe CreditAttribution: ruscoe commentedTested and works, committed to the dev branch. Thanks for the patch!
Comment #8
aasarava CreditAttribution: aasarava commentedSorry to reopen this, but this patch seems to inadvertently prevent new users from being subscribed to lists that they choose on the subscription form.
If you create a new user and select one or more lists, the user doesn't get subscribed to those lists and the user edit form shows the fields as unchecked.
I believe this is happening because the following lines of the patch just wipe out any field data in $choices:
Maybe check to see if there's any value at all in $entity_wrapper->{$instance['field_name']} first?
Comment #9
ruscoe CreditAttribution: ruscoe commentedComment #11
ruscoe CreditAttribution: ruscoe commentedGood catch. Confirmed the issue and committed a fix. Thank you!
Comment #12
ruscoe CreditAttribution: ruscoe commentedComment #13
aasarava CreditAttribution: aasarava commentedGreat. It works. Thanks!
Comment #14
karel010 CreditAttribution: karel010 commented@ruscoe
8d1de27 does not work. $choices is always
array('subscribed' => 0)
when the field value is not provided in the entity. This isbecause entity_metadata_wrapper
callsmailchimp_lists_field_get
. Testing against$entity
directly does work.Comment #15
joelpittetBased on #14 moving to NW
Comment #17
ruscoe CreditAttribution: ruscoe commentedComment #18
karel010 CreditAttribution: karel010 commentedComment #21
ruscoe CreditAttribution: ruscoe commentedThank you, @karel010
Comment #22
ruscoe CreditAttribution: ruscoe commented