Merge pull request #15745 from seamuslee001/master
[civicrm-core.git] / CRM / Profile / Form.php
index 9052831d2b5b41fe4b6aaad0a30fa622f1aea15f..1695d4490e3a5cfc9e3d6005ef35be7505541699 100644 (file)
@@ -200,7 +200,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
     }
     else {
       // for edit mode we need to allow our own record to be a dupe match!
-      $exceptions = [$form->_session->get('userID')];
+      $exceptions = [CRM_Core_Session::singleton()->get('userID')];
     }
     $contactType = CRM_Core_BAO_UFGroup::getContactType($form->_gid);
     // If all profile fields is of Contact Type then consider
@@ -308,8 +308,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
       }
     }
 
-    $this->_session = CRM_Core_Session::singleton();
-    $this->_currentUserID = $this->_session->get('userID');
+    $this->_currentUserID = CRM_Core_Session::singleton()->get('userID');
 
     if ($this->_mode == self::MODE_EDIT) {
       //specifies the action being done on a multi record field
@@ -497,7 +496,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
 
         if (!$emailField) {
           $status = ts("Email field should be included in profile if you want to use Group(s) when Profile double-opt in process is enabled.");
-          $this->_session->setStatus($status);
+          CRM_Core_Session::singleton()->setStatus($status);
         }
       }
 
@@ -1120,7 +1119,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
       $contactDetails = CRM_Contact_BAO_Contact::getHierContactDetails($this->_id,
         $greetingTypes
       );
-      $details = $contactDetails[0][$this->_id];
+      $details = $contactDetails[$this->_id];
     }
     if (!(!empty($details['addressee_id']) || !empty($details['email_greeting_id']) ||
       CRM_Utils_Array::value('postal_greeting_id', $details)