Skip to content

Commit

Permalink
Fix for CRM-314
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniessh Sethh committed Aug 16, 2018
1 parent a26f426 commit 2ddf0fc
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions CRM/Event/Form/SelfSvcTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,22 @@ public function postProcess() {
}
else {
//cancel 'from' participant row
$query = "select contact_id from civicrm_email where email = '" . $params['email'] . "'";
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$contact_id = $dao->contact_id;
try{
$contact_id_result = civicrm_api3('Contact', 'get', array(
'sequential' => 1,
'return' => array("id"),
'email' => $params['email'],
'options' => array('limit' => 1),
));
$contact_id_result = $contact_id_result['values'][0];
$contact_id = $contact_id_result['contact_id'];
$contact_is_deleted = $contact_id_result['contact_is_deleted'];
if ($contact_is_deleted || !is_numeric($contact_id)) {
CRM_Core_Error::statusBounce(ts('Contact does not exist.'));
}
}
catch (CiviCRM_API3_Exception $e) {
CRM_Core_Error::statusBounce(ts('Contact does not exist.'));
}
}
$from_participant = $params = array();
Expand Down

0 comments on commit 2ddf0fc

Please sign in to comment.