I found a bug that causes a PHP error (or "white screen" when errors are not visible).

Conditions to reproduce:

  • Install Drupal Commerce
  • Install MailJet and the MailJet_stats submodule
  • Don't install the mailjet_campaign module

The error:
When you proceed through checkout and would normally get to the Checkout Complete screen, that's when the error occurs: Fatal error: Call to undefined function mailjet_campaign_load(). That's because the function mailjet_stats_commerce_checkout_complete() is calling mailjet_campaign_load(), but the mailjet_campaign module isn't installed, and therefore the function isn't available.

The fix:
Add a check such as function_exists() or module_exists().

CommentFileSizeAuthor
#2 mailjet_stats_campaign-2966667-2.patch829 byteshargobind

Comments

hargobind created an issue. See original summary.

hargobind’s picture

StatusFileSize
new829 bytes

Attached is a patch which adds a function_exists() check.

If you use this patch or any of the code in it, please follow Drupal's best practices for commit messages. Please have a look at Commit messages - providing history and credit. In short, use the syntax Issue #[issue number] by [comma-separated usernames]: [Short summary of the change]. This helps commits appear in the issue queue automatically, and gives commit credits to people who have authored patches for your projects.

hargobind’s picture

Status: Active » Needs review
mailjet plugins’s picture

Status: Needs review » Fixed

The issue has been fixed in v. 7.x-2.18

mailjet plugins’s picture

Status: Fixed » Closed (fixed)