Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
129c0d01
Unverified
Commit
129c0d01
authored
2 years ago
by
DaveD
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #25451 from eileenmcnaughton/num
Do not attempt to format custom value of empty string
parents
5d312c36
97f9a5f3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/BAO/CustomField.php
+9
-6
9 additions, 6 deletions
CRM/Core/BAO/CustomField.php
with
9 additions
and
6 deletions
CRM/Core/BAO/CustomField.php
+
9
−
6
View file @
129c0d01
...
...
@@ -1129,6 +1129,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
* @param int|null $entityId
*
* @return string
* @throws \Brick\Money\Exception\UnknownCurrencyException
*/
private
static
function
formatDisplayValue
(
$value
,
$field
,
$entityId
=
NULL
)
{
...
...
@@ -1269,19 +1270,21 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
break
;
case
'Text'
:
if
(
$field
[
'data_type'
]
==
'Money'
&&
isset
(
$value
))
{
if
(
$field
[
'data_type'
]
==
=
'Money'
&&
isset
(
$value
))
{
// $value can also be an array(while using IN operator from search builder or api).
$values
=
[];
foreach
((
array
)
$value
as
$val
)
{
$
disp
[]
=
CRM_Utils_Money
::
formatLocaleNumericRoundedForDefaultCurrency
(
$val
);
$
values
[]
=
$val
===
''
?
''
:
CRM_Utils_Money
::
formatLocaleNumericRoundedForDefaultCurrency
(
$val
);
}
$display
=
implode
(
', '
,
$
disp
);
$display
=
implode
(
', '
,
$
values
);
}
elseif
(
$field
[
'data_type'
]
==
'Float'
&&
isset
(
$value
))
{
elseif
(
$field
[
'data_type'
]
==
=
'Float'
&&
isset
(
$value
))
{
// $value can also be an array(while using IN operator from search builder or api).
$values
=
[];
foreach
((
array
)
$value
as
$val
)
{
$
disp
[]
=
CRM_Utils_Number
::
formatLocaleNumeric
(
$val
);
$
values
[]
=
$val
===
''
?
''
:
CRM_Utils_Number
::
formatLocaleNumeric
(
$val
);
}
$display
=
implode
(
', '
,
$
disp
);
$display
=
implode
(
', '
,
$
values
);
}
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment