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

Commit

Permalink
Merge pull request #112 from mathavanveda/print_pdf_error
Browse files Browse the repository at this point in the history
Print pdf from contribution view retrun db error, altermailparams hoo…
  • Loading branch information
JoeMurray authored Sep 19, 2018
2 parents f227f3e + 110005e commit 65ecace
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 65ecace

Please sign in to comment.