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
8cb5abdd
Unverified
Commit
8cb5abdd
authored
2 weeks ago
by
Monish Deb
Committed by
GitHub
2 weeks ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #32592 from jaapjansma/issue_5830
#5830
CaseType api (v4) returns empty definition
parents
858c7e3f
ee5b1bdd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Civi/Api4/Utils/FormattingUtil.php
+2
-2
2 additions, 2 deletions
Civi/Api4/Utils/FormattingUtil.php
tests/phpunit/api/v4/Entity/CaseTest.php
+19
-0
19 additions, 0 deletions
tests/phpunit/api/v4/Entity/CaseTest.php
with
21 additions
and
2 deletions
Civi/Api4/Utils/FormattingUtil.php
+
2
−
2
View file @
8cb5abdd
...
...
@@ -239,8 +239,8 @@ class FormattingUtil {
}
}
foreach
(
$result
as
$key
=>
$value
)
{
// Skip
null values or
values that have already been unset by `formatOutputValue` functions
if
(
!
isset
(
$result
[
$key
]
))
{
// Skip values that have already been unset by `formatOutputValue` functions
if
(
!
array_key_exists
(
$key
,
$result
))
{
continue
;
}
// Use ??= to only convert each column once
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/api/v4/Entity/CaseTest.php
+
19
−
0
View file @
8cb5abdd
...
...
@@ -23,6 +23,7 @@ use api\v4\Api4TestBase;
use
Civi\API\Exception\UnauthorizedException
;
use
Civi\Api4\Activity
;
use
Civi\Api4\CaseActivity
;
use
Civi\Api4\CaseType
;
use
Civi\Api4\CiviCase
;
use
Civi\Api4\Relationship
;
...
...
@@ -114,6 +115,24 @@ class CaseTest extends Api4TestBase {
$this
->
assertEquals
([
'Closed'
,
'Testing'
],
$options
);
}
public
function
testCaseTypeDefinition
():
void
{
$caseType
=
$this
->
createTestRecord
(
'CaseType'
,
[
'title'
=>
'Test Case Type'
,
'name'
=>
'test_case_type3'
,
'definition'
=>
[
'statuses'
=>
[
'Testing'
,
'Closed'
],
],
]);
$caseTypeToTest
=
CaseType
::
get
(
FALSE
)
->
addSelect
(
'definition'
)
->
addWhere
(
'name'
,
'='
,
'test_case_type3'
)
->
execute
()
->
first
();
$this
->
assertArrayHasKey
(
'definition'
,
$caseTypeToTest
);
$this
->
assertNotNull
(
$caseTypeToTest
[
'definition'
]);
}
public
function
testCaseActivity
():
void
{
$case1
=
$this
->
createTestRecord
(
'Case'
);
$case2
=
$this
->
createTestRecord
(
'Case'
);
...
...
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