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
9ec90e57
Commit
9ec90e57
authored
12 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
fix for note api test failure
parent
cddb5b6f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/api.php
+1
-1
1 addition, 1 deletion
api/api.php
api/v3/Generic.php
+15
-3
15 additions, 3 deletions
api/v3/Generic.php
with
16 additions
and
4 deletions
api/api.php
+
1
−
1
View file @
9ec90e57
...
...
@@ -51,7 +51,7 @@ function civicrm_api($entity, $action, $params, $extra = NULL) {
// we do this before we
_civicrm_api3_swap_out_aliases
(
$apiRequest
);
if
(
strtolower
(
$action
)
!=
'getfields'
)
{
if
(
!
CRM_Utils_Array
::
value
(
'id'
,
$params
))
{
if
(
!
CRM_Utils_Array
::
value
(
'id'
,
$
apiRequest
[
'
params
'
]
))
{
$apiRequest
[
'params'
]
=
array_merge
(
_civicrm_api3_getdefaults
(
$apiRequest
),
$apiRequest
[
'params'
]);
}
//if 'id' is set then only 'version' will be checked but should still be checked for consistency
...
...
This diff is collapsed.
Click to expand it.
api/v3/Generic.php
+
15
−
3
View file @
9ec90e57
...
...
@@ -69,11 +69,23 @@ function civicrm_api3_generic_getfields($apiRequest) {
$unique
=
FALSE
;
case
'get'
:
$metadata
=
_civicrm_api_get_fields
(
$apiRequest
[
'entity'
],
$unique
,
$apiRequest
[
'params'
]);
if
(
empty
(
$metadata
[
'id'
])
&&
!
empty
(
$metadata
[
strtolower
(
$apiRequest
[
'entity'
])
.
'_id'
]))
{
$metadata
[
'id'
]
=
$metadata
[
$lcase_entity
.
'_id'
];
if
(
empty
(
$metadata
[
'id'
])){
// if id is not set we will set it eg. 'id' from 'case_id', case_id will be an alias
if
(
!
empty
(
$metadata
[
strtolower
(
$apiRequest
[
'entity'
])
.
'_id'
]))
{
$metadata
[
'id'
]
=
$metadata
[
$lcase_entity
.
'_id'
];
unset
(
$metadata
[
$lcase_entity
.
'_id'
]);
$metadata
[
'id'
][
'api.aliases'
]
=
array
(
$lcase_entity
.
'_id'
);
}
}
else
{
// really the preference would be to set the unique name in the xml
// question is which is a less risky fix this close to a release - setting in xml for the known failure
// (note) or setting for all api where fields is returning 'id' & we want to accept 'note_id' @ the api layer
// nb we don't officially accept note_id anyway - rationale here is more about centralising a now-tested
// inconsistency
$metadata
[
'id'
][
'api.aliases'
]
=
array
(
$lcase_entity
.
'_id'
);
unset
(
$metadata
[
$lcase_entity
.
'_id'
]);
}
break
;
case
'delete'
:
...
...
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