Problem/Motivation

If you don't have a session (e.g. running via cron), getCampaignId errors.

Proposed resolution

This will fix it using PHP8 and later.

MailchimpEcommerceHelper.php
line 110:
$session_campaign = $this->request->getSession()->get('mc_cid', '');
should change to
$session_campaign = $this->request->getSession()?->get('mc_cid', '');

CommentFileSizeAuthor
campaign-id-null.patch585 bytessusie

Comments

susie created an issue. See original summary.

  • xenophyle committed 1c80dc5b on 2.x
    Issue #3483319 by susie: getCampaignId errors when no session
    
xenophyle’s picture

Status: Active » Fixed

@susie Since this version still supports PHP 7, I committed a version of your solution that is compatible with that.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.