Problem/Motivation

If a user selects a list segment to send a campaign to, it shows an error on that campaign view page.
Steps to reproduce:

  • Install Mailchimp 8.x-1.7 on Drupal 8.6.2
  • Enable Mailchimp, MailChimp Campaign, and MailChimp Lists modules
  • Add new MailChimp Campaign and select a List Segment to send to
  • Save as draft
  • Click on View for newly created campaign
  • Receive several errors about undefined property $mc_data

Proposed resolution

Update MailchimpCampaignViewBuilder.php on line 48, to use $entity instead of$this

Remaining tasks

Reviews needed

User interface changes

None

API changes

None

Data model changes

None

Comments

averagejoe3000 created an issue. See original summary.

averagejoe3000’s picture

StatusFileSize
new908 bytes
avpaderno’s picture

Version: 8.x-1.7 » 8.x-1.x-dev
Status: Active » Needs review
firfin’s picture

StatusFileSize
new908 bytes

Experienced the same problem, manually applying the patch from #2 solved it.
So +1 for this solution, thanks @averagejoe3000

Patch did not apply to dev version anymore though. Re-roll attached.
Removed tests for ancient PHP version, because https://www.drupal.org/node/2938726

Errors:

Notice: Trying to get property 'recipients' of non-object in Drupal\mailchimp_campaign\Entity\MailchimpCampaignViewBuilder->view() (line 101 of modules/contrib/mailchimp/modules/mailchimp_campaign/src/Entity/MailchimpCampaignViewBuilder.php).

Notice: Trying to get property 'segment_opts' of non-object in Drupal\mailchimp_campaign\Entity\MailchimpCampaignViewBuilder->view() (line 101 of modules/contrib/mailchimp/modules/mailchimp_campaign/src/Entity/MailchimpCampaignViewBuilder.php).

Notice: Trying to get property 'saved_segment_id' of non-object in Drupal\mailchimp_campaign\Entity\MailchimpCampaignViewBuilder->view() (line 101 of modules/contrib/mailchimp/modules/mailchimp_campaign/src/Entity/MailchimpCampaignViewBuilder.php).
Drupal\mailchimp_campaign\Entity\MailchimpCampaignViewBuilder->view(Object) (Line: 248)
Drupal\mailchimp_campaign\Controller\MailchimpCampaignController->view(Object)

gcb’s picture

Assigned: Unassigned » itrebecca

  • firfin authored 25b15ea on issue-3008883
    Issue #3008883 by averagejoe3000, firfin: Selected list segment not...

  • gcb committed 438cd82 on 8.x-1.x authored by firfin
    Issue #3008883 by averagejoe3000, firfin: Selected list segment not...
xenophyle’s picture

Status: Needs review » Closed (won't fix)

Thanks for submitting this ticket — and sorry we didn’t get back to you about it sooner. We are cleaning up old issues and issue for old versions and are going to close this one. If this issue is still relevant for you, please re-open it and update the “Version” field, and include any updates to the behavior you are seeing.With a smaller issue queue, we’ll have an easier time getting back to you.