X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FProfile.php;h=17463bb1a3a003cd5446567da43ca658b0bc71d7;hb=2d82d5a2151b9e9ac865f223521836ea4d530566;hp=73ea34dc7ae534d6577aee01f128ea212f193b38;hpb=8de7047a8762a15823f6bd10b94447d3d83937e2;p=civicrm-core.git diff --git a/api/v3/Profile.php b/api/v3/Profile.php index 73ea34dc7a..17463bb1a3 100644 --- a/api/v3/Profile.php +++ b/api/v3/Profile.php @@ -515,10 +515,10 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = $profileFields[$profileID][$fieldName] = array_merge([ 'api.required' => $field['is_required'], 'title' => $field['label'], - 'help_pre' => CRM_Utils_Array::value('help_pre', $field), - 'help_post' => CRM_Utils_Array::value('help_post', $field), + 'help_pre' => $field['help_pre'] ?? NULL, + 'help_post' => $field['help_post'] ?? NULL, 'entity' => $entity, - 'weight' => CRM_Utils_Array::value('weight', $field), + 'weight' => $field['weight'] ?? NULL, ], $aliasArray); $ufFieldTaleFieldName = $field['field_name']; @@ -608,13 +608,13 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = } /** - * @param $a - * @param $b + * @param array $a + * @param array $b * * @return bool */ function _civicrm_api3_order_by_weight($a, $b) { - return CRM_Utils_Array::value('weight', $b) < CRM_Utils_Array::value('weight', $a) ? TRUE : FALSE; + return ($b['weight'] ?? 0) < ($a['weight'] ?? 0); } /** @@ -731,7 +731,7 @@ function _civicrm_api3_profile_appendaliases($values, $entity) { } //special case on membership & contribution - can't see how to handle in a generic way if (in_array($entity, ['membership', 'contribution'])) { - $values['send_receipt'] = ['title' => 'Send Receipt', 'type' => (int) 16]; + $values['send_receipt'] = ['title' => 'Send Receipt', 'type' => 16]; } return $values; }