From d35e06da623444d72033dc93019188207e8af43b Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" Date: Tue, 16 Jul 2019 10:12:35 +0100 Subject: [PATCH] Use singleton to get session instead of relying on ->_session being set elsewhere --- CRM/Profile/Form.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 9052831d2b..0013777bee 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -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); } } -- 2.25.1