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

CRM-20834 - Drupal user not created via Profile due to missing email #10636

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions CRM/Contribute/Form/Contribution/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,14 @@ protected function processFormSubmission($contactID) {
if (!empty($this->_ccid)) {
$this->_params['contribution_id'] = $this->_ccid;
}
//Set email-bltID if pre/post profile contains an email.
if ($this->_emailExists == TRUE) {
foreach ($this->_params as $key => $val) {
if (substr($key, 0, 6) == 'email-' && empty($this->_params["email-{$this->_bltID}"])) {
$this->_params["email-{$this->_bltID}"] = $this->_params[$key];
}
}
}
// add a description field at the very beginning
$this->_params['description'] = ts('Online Contribution') . ': ' . (($this->_pcpInfo['title']) ? $this->_pcpInfo['title'] : $this->_values['title']);

Expand Down
2 changes: 2 additions & 0 deletions CRM/Contribute/Form/ContributionBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public function preProcess() {
// lets just bump this to a regular session error and redirect user to main page
$this->controller->invalidKeyRedirect();
}
$this->_emailExists = $this->get('emailExists');

// this was used prior to the cleverer this_>getContactID - unsure now
$this->_userID = CRM_Core_Session::singleton()->getLoggedInContactID();
Expand Down Expand Up @@ -652,6 +653,7 @@ public function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType =
!in_array($profileContactType, array('honor', 'onbehalf'))
) {
$this->_emailExists = TRUE;
$this->set('emailExists', TRUE);
}
}

Expand Down