Skip to content

Commit

Permalink
Merge pull request #14832 from mattwire/profileformsession
Browse files Browse the repository at this point in the history
Use singleton to get session instead of relying on ->_session being set elsewhere
  • Loading branch information
colemanw authored Jul 16, 2019
2 parents 9c68f97 + d35e06d commit 4e0d128
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CRM/Profile/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected static function handleDuplicateChecking(&$errors, $fields, $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
Expand Down Expand Up @@ -308,8 +308,7 @@ public function preProcess() {
}
}

$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
Expand Down Expand Up @@ -497,7 +496,7 @@ public function preProcess() {

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);
}
}

Expand Down

0 comments on commit 4e0d128

Please sign in to comment.