Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use singleton to get session instead of relying on ->_session being set elsewhere #14832

Merged
merged 1 commit into from
Jul 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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