CRM-16319 - Code Sniffer Warning Fix
authoratif-shaikh <shaikh388@gmail.com>
Mon, 27 Apr 2015 10:44:03 +0000 (16:14 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Mon, 27 Apr 2015 10:44:03 +0000 (16:14 +0530)
----------------------------------------
* CRM-16319: CiviEvent Registration Invoice Fatal Error
  https://issues.civicrm.org/jira/browse/CRM-16319

CRM/Contribute/Form/Task/Invoice.php

index a7cbd4ad033e3f13cb1322dbe971a89ff8f18fb7..9693c4b769cf9973045592c464aa3e62a16327b6 100644 (file)
@@ -464,9 +464,12 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
         'PDFFilename' => 'Invoice.pdf',
       );
       $session = CRM_Core_Session::singleton();
+      $contactID = $session->get('userID');
       //CRM-16319 - we dont store in userID in case the user is doing multiple
       //transactions etc
-      $contactID = empty($session->get('userID')) ? $session->get('transaction.userID') : $session->get('userID');
+      if (empty($contactID)) {
+        $contactID = $session->get('transaction.userID');
+      }
       $contactEmails = CRM_Core_BAO_Email::allEmails($contactID);
       $emails = array();
       $fromDisplayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',