Skip to content

Commit

Permalink
Merge pull request #882 from MegaphoneJon/billing-email-check
Browse files Browse the repository at this point in the history
fix check for billing email when contributor isn't contact 1
  • Loading branch information
KarinG committed Jun 8, 2023
2 parents 1c630f8 + 3b14c17 commit 2e66821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/WebformCivicrmPostProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -1846,9 +1846,9 @@ private function validateBillingFields() {
$valid = FALSE;
}
// Email
for ($i = 1; $i <= $this->data['contact'][1]['number_of_email']; ++$i) {
if (!empty($this->crmValues["civicrm_1_contact_{$i}_email_email"])) {
$c = $this->getContributionContactIndex();
$c = $this->getContributionContactIndex();
for ($i = 1; $i <= $this->data['contact'][$c]['number_of_email']; ++$i) {
if (!empty($this->crmValues["civicrm_{$c}_contact_{$i}_email_email"])) {
$params['email'] = $this->crmValues["civicrm_{$c}_contact_{$i}_email_email"];
break;
}
Expand Down

0 comments on commit 2e66821

Please sign in to comment.