Skip to content

Commit

Permalink
[REF] Minor code cleanup
Browse files Browse the repository at this point in the history
Do not pass params as reference as unchanged
  • Loading branch information
eileenmcnaughton committed May 3, 2020
1 parent 45aa6ba commit 7b6485a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CRM/Contribute/BAO/ContributionPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public static function setValues($id, &$values) {
* Return the message text instead of sending the mail.
*
* @param array $fieldTypes
*
* @throws \CRM_Core_Exception
*/
public static function sendMail($contactID, $values, $isTest = FALSE, $returnMessageText = FALSE, $fieldTypes = NULL) {
$gIds = [];
Expand Down Expand Up @@ -472,23 +474,22 @@ public static function sendMail($contactID, $values, $isTest = FALSE, $returnMes
* @param array $fieldTypes
*
* @return array
*
* @throws \CRM_Core_Exception
*/
protected static function getProfileNameAndFields($gid, $cid, &$params, $fieldTypes = []) {
protected static function getProfileNameAndFields($gid, $cid, $params, $fieldTypes = []) {
$groupTitle = NULL;
$values = [];
if ($gid) {
if (CRM_Core_BAO_UFGroup::filterUFGroups($gid, $cid)) {
$fields = CRM_Core_BAO_UFGroup::getFields($gid, FALSE, CRM_Core_Action::VIEW, NULL, NULL, FALSE, NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL);
foreach ($fields as $k => $v) {
if (!$groupTitle) {
$groupTitle = $v["groupTitle"];
$groupTitle = $v['groupTitle'];
}
// suppress all file fields from display and formatting fields
if (
CRM_Utils_Array::value('data_type', $v, '') == 'File' ||
CRM_Utils_Array::value('name', $v, '') == 'image_URL' ||
CRM_Utils_Array::value('field_type', $v) == 'Formatting'
) {
$v['data_type'] === 'File' || $v['name'] === 'image_URL' || $v['field_type'] === 'Formatting') {
unset($fields[$k]);
}

Expand Down

0 comments on commit 7b6485a

Please sign in to comment.