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.