X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FContribution%2FMain.php;h=2187147acd2be48e54d3a3e4a9ac201d1c6e8c6e;hb=52186d7b704657815e0c9bf633b82d331a2c4092;hp=f3cfc33270ef490bd40f5fa50b8b5ee3de0fe48b;hpb=13d421f615c01ef29ec1d5fc01805abcec00d25d;p=civicrm-core.git diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index f3cfc33270..2187147acd 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -341,12 +341,14 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $this->applyFilter('__ALL__', 'trim'); if (empty($this->_ccid)) { - $this->add('text', "email-{$this->_bltID}", - ts('Email Address'), - array('size' => 30, 'maxlength' => 60, 'class' => 'email'), - TRUE - ); - $this->addRule("email-{$this->_bltID}", ts('Email is not valid.'), 'email'); + if ($this->_emailExists == FALSE) { + $this->add('text', "email-{$this->_bltID}", + ts('Email Address'), + array('size' => 30, 'maxlength' => 60, 'class' => 'email'), + TRUE + ); + $this->addRule("email-{$this->_bltID}", ts('Email is not valid.'), 'email'); + } } else { $this->addElement('hidden', "email-{$this->_bltID}", 1); @@ -727,11 +729,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu // For anonymous user check using dedupe rule // if user has Cancelled Membership if (!$memContactID) { - $dedupeParams = CRM_Dedupe_Finder::formatParams($fields, 'Individual'); - $dedupeParams['check_permission'] = FALSE; - $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual'); - // if we find more than one contact, use the first one - $memContactID = CRM_Utils_Array::value(0, $ids); + $memContactID = CRM_Contact_BAO_Contact::getFirstDuplicateContact($fields, 'Individual', 'Unsupervised', array(), FALSE); } $currentMemberships = CRM_Member_BAO_Membership::getContactsCancelledMembership($memContactID, $is_test