1

I just created a contribution (Payment) page in CiviCRM 4.7.27, and I was testing it. I put in an e-mail address in the "from" field, but I left the "from name" blank (it was not shown as required on the form).

When I confirmed the payment, I got the following warning message:

Notice: Undefined index: receipt_from_name in CRM_Contribute_BAO_Contribution::generateFromEmailAndName() (line 4741 of /home/secondci/public_html/drupal/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php).

An e-mail was sent, but the "from" address was the default for our site: "webmaster@..." not what I had put in the payment form: "registrar@..."

This seems to be similar to errors reported by other users. That line of code in Contribution.php looks like this:

  return array($pageValues['receipt_from_name'], $pageValues['receipt_from_email']);

I changed it to this:

  return (array_key_exists() ? array($pageValues['receipt_from_name'], $pageValues['receipt_from_email']) : array(' ', $pageValues['receipt_from_email']));

Is this the right thing to do? I have just registered for the CiviCRM site, if that is the correct place to post something like this. Any other suggestions?

Oh, and there is a typo on line 4730:

// Use input valuse if supplied.
2
  • Welcome Michael, can you tell us what version of the CiviCRM you are using? Thanks for reporting the typo in the comment. It's not advisable to edit the CiviCRM code directly but did your edit solve the issue? Consider browsing the Issue Tracker or filing a report: issues.civicrm.org/jira/projects/CRM/issues/…
    – Christia
    Commented Nov 29, 2017 at 16:21
  • I am using 4.7.27, and the change in code did make the warning go away. I've just registered for civicrm.org, and I'll attempt to file a report there. Commented Nov 29, 2017 at 20:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.