Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Commit

Permalink
Print pdf from contribution view retrun db error, altermailparams hoo…
Browse files Browse the repository at this point in the history
…k expect toEmail which is not exits. it cause error while creating mailing event queue
  • Loading branch information
mathavanveda committed Mar 28, 2018
1 parent 86725f8 commit 110005e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mte.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ function mte_civicrm_alterMailParams(&$params, $context = NULL) {
$userID = $session->get('userID');
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
$params['toEmail'] = trim($params['toEmail']); // BRES-103 Prevent silent failure when emails with whitespaces are used.

//[email protected], 28/03/2018.
//In Civi, hook_civicrm_alterMailParams would call while printing PDF as well.
//we cannot expect toEmail from params when printing PDF(Invoice), which cause DB Constraint error while mte_createQueue();
if (empty($params['toEmail'])) {
return FALSE;
}

$config = CRM_Core_Config::singleton();
if (property_exists($config, 'civiVersion')) {
$civiVersion = $config->civiVersion;
Expand Down

0 comments on commit 110005e

Please sign in to comment.