CRM-16580 cast contactID to an int when it is zero as currently it is inconsistent
authoreileenmcnaughton <eileen@fuzion.co.nz>
Fri, 29 May 2015 00:36:07 +0000 (00:36 +0000)
committereileenmcnaughton <eileen@fuzion.co.nz>
Fri, 29 May 2015 00:36:07 +0000 (00:36 +0000)
CRM/Contribute/Form/Contribution/Main.php
CRM/Core/Form.php
CRM/Event/Form/Registration/Register.php

index 5f633b3e92fc6c56ec67ffe81cc6c9c29a79210f..646397bf03f4b013aae26fc28e685c2e96ba7b13 100644 (file)
@@ -459,9 +459,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
     }
 
     $contactID = $this->getContactID();
-    if ($this->getContactID() === '0') {
+    if ($this->getContactID() === 0) {
       $this->addCidZeroOptions($onlinePaymentProcessorEnabled);
     }
+
     //build pledge block.
     $this->_useForMember = 0;
     //don't build membership block when pledge_id is passed
index 46209e8653e5b1b30f077df26c0fce4940457832..6441a57502e352f6997b110417323140cd101e66 100644 (file)
@@ -1598,13 +1598,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       // from that page
       // we don't really need to set it when $tempID is set because the params have that stored
       $this->set('cid', 0);
-      return $tempID;
+      return (int) $tempID;
     }
 
     $userID = $this->getLoggedInUserContactID();
 
     if ($tempID == $userID) {
-      return $userID;
+      return (int) $userID;
     }
 
     //check if this is a checksum authentication
index fab803166b3776d416bcbc9baddbe9c3f15acd00..0adedbbbb45c16d50c3c0ede7fd31b64468570a3 100644 (file)
@@ -430,7 +430,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         $pps[$key] = $name['name'];
       }
     }
-    if ($this->getContactID() === '0' && !$this->_values['event']['is_multiple_registrations']) {
+    if ($this->getContactID() === 0 && !$this->_values['event']['is_multiple_registrations']) {
       //@todo we are blocking for multiple registrations because we haven't tested
       $this->addCidZeroOptions($onlinePaymentProcessorEnabled);
     }