Closed (fixed)
Project:
Mailchimp
Version:
2.x-dev
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
21 Jun 2018 at 15:36 UTC
Updated:
25 Dec 2024 at 20:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
peacog commentedHere's a patch that fixes the bug.
Comment #3
peacog commentedI've updated the patch to handle radio groups on the entity edit form.
More work in needed on this. Right now if you change a radio option the new value is added to the group in mailchimp instead of replacing the original value.
Comment #4
peacog commentedThe previous approach resulted in quite a bit of duplicate code so I have slightly changed the approach and have resolved the problem of multiple values for radio style categories being seen at the mailchimp website.
A few things to note: for radio button categories to work two other patches are required: #2984542: Subscription field values are not saved to the database and #2981876: Store interest groups as serialized arrays. This patch in this issue should be applied before the one in #2984542: Subscription field values are not saved to the database.
Comment #5
samuel.mortensonComment #6
rjacobsen0 commentedThe previous patch is good, but just slightly off the mark. Possibly the code changed, so the patch needed an update. I fixed it so it will save group information, where the group is presented as radio buttons. Thanks for the good work!
Comment #7
rjacobsen0 commentedDoing some tests...
1. Create a Mailchimp signup field on /admin/config/people/accounts/fields. Open an incognito browser window and request a new account on your D8 site. You will need to clear cache before you can load your D8 site to do so.
2. Subscribe is not working in this case.
Stopping tests there. Will try to fix, then test more.
Comment #8
rjacobsen0 commentedComment #9
samuel.mortensonComment #10
aprice42 commentedRerolled patch with the latest.
Comment #11
aprice42 commentedThis patch adds a fix to ensure the default value for a radio button is shown on the field config for a Mailchimp Subscription field.
Comment #12
aprice42 commentedComment #13
Bagz commentedObservation: there seems to be some crossover with https://www.drupal.org/project/mailchimp/issues/2981876.
Additional comment:
This patch appears to be dealing with two issues:
- form default values missing for radio buttons
- Invalid argument supplied for foreach() in MailchimpListsSubscription->preSave() (line 285 of of MailchimpListsSubscription.php)
Since I came across the same issue I created a patch for just the form default issue. I have a feeling the other issue may already have been dealt with in the latest dev version.
I am also not sure if the default value should be a string for "select" field types as well as as radio buttons, unless the select field is a multi-value select field, i haven't had time to check or test.
I have attached my patch fwiw which deals with the form default for radio buttons (and selects) slightly differently.
Comment #14
gcbComment #15
gcbComment #16
dtrdewaele commentedComment #20
Anonymous (not verified) commentedHi @xenophyle
There seems to be a merge conflict in MR!98 that needs to be resolved
Comment #21
xenophyle commented@akulsaxena I am working on this but need to stop for a couple hours, so it won't be ready until then.
Comment #22
Anonymous (not verified) commentedOkay, Will follow the issue to see the updates,
Thanks
Comment #24
xenophyle commentedNext step: port to 3.x.
Comment #26
xenophyle commented