Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Minor code cleanup #17225

Merged
merged 1 commit into from
May 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw tada

unset($fields[$k]);
}

Expand Down