Template selection can be improved upon. The way mailchimp module does it (select list populated with valid templates) is much more user-friendly.

Gonna make a patch for this.

CommentFileSizeAuthor
#1 1909636-selectlist-for-template.patch1.24 KBfirfin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

firfin’s picture

Status: Active » Needs review
FileSize
1.24 KB

Patch attached.

mubiesam’s picture

is it correct to apply the patch under sites/all/modules/mcc/mcc.module ?

I got nothing changed, still the textfield instead of select list...

Thanks,

firfin’s picture

@mubiesam: That is probably because of the defaults and caching MCC uses. I got that too sometimes.
Just save all your defaults/configuration for MCC again (sitewide, nodetype) then create a new node and then create a new campaign from that.

The patch should be run from the module directory as usual (i.e. .../modules/mcc/ in this case.)

mubiesam’s picture

Thanks for the reply...

I had decided not to use too many templates, but just stick to one.

But after changing the template id from 1000188 to 73737 in both drupal SITEWIDE DEFAULT MAILCHIMP CAMPAIGN SETTINGS and sites/all/modules/mcc/mcc.settings.inc , it still appeared the 1000188 in template id field while CREATE NEW MAILCHIMP CAMPAIGN...

Do you have idea why is this happening...

Thanks,
Sam

firfin’s picture

First of all, I think you should probably open another issue for this different issue/question.
It is not exactly clear to me what you are doing, but it doesn't seem related to this patch / issue?

But as a quick answer, I would check the database to see if the value has changed there (for site and CT defaults) and work from there. Resave settings through the UI, create new content and campaigns, see what happens to DB.

Sutharsan’s picture

Status: Needs review » Needs work

I reviewed the patch:

+++ b/mcc.module
@@ -699,6 +699,19 @@ function _mcc_lists_options() {
+function _mcc_template_id_options() {
+  $ids = mailchimp_campaign_get_templates();
+  $options = array('' => t('-- Select --'));
+  foreach ($ids as $item) {
+    $options[$item['id']] = $item['name'];
+  }
+

This code uses a function from mailchimp_campaign module. This implies a dependency on mailchimp_campaign. However mailchimp_campaign and mcc both define the path "admin/config/services/mailchimp/campaigns". Even when changing the path, this will cause confusion in the interface. A quick and dirty solution is to copy the function mailchimp_campaign_get_templates() into mcc.

firfin’s picture

Thank you for your review @Sutharsan. I will get back on this next week.

firfin’s picture

Assigned: Unassigned » firfin
Issue summary: View changes

Still getting used to new issue queue ;-)

firfin’s picture

Assigned: firfin » Unassigned

No sense floggin a dead horse..