Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
justinfreeman (Agileware)
Core
Commits
e310e129
Commit
e310e129
authored
12 years ago
by
gitsync
Browse files
Options
Downloads
Patches
Plain Diff
CRM-12133 - api/v3/CustomSearch - Fix option_group_id error
parent
1c6b7d30
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/v3/CustomSearch.php
+3
-0
3 additions, 0 deletions
api/v3/CustomSearch.php
tests/phpunit/api/v3/CustomSearchTest.php
+4
-4
4 additions, 4 deletions
tests/phpunit/api/v3/CustomSearchTest.php
with
7 additions
and
4 deletions
api/v3/CustomSearch.php
+
3
−
0
View file @
e310e129
...
...
@@ -54,6 +54,9 @@ function civicrm_api3_custom_search_create($params) {
function
_civicrm_api3_custom_search_create_spec
(
&
$params
)
{
require_once
'api/v3/OptionValue.php'
;
_civicrm_api3_option_value_create_spec
(
$params
);
$params
[
'option_group_id'
][
'api.default'
]
=
CRM_Core_DAO
::
getFieldValue
(
'CRM_Core_DAO_OptionGroup'
,
'custom_search'
,
'id'
,
'name'
);
$params
[
'name'
][
'api.aliases'
]
=
array
(
'class_name'
);
}
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/api/v3/CustomSearchTest.php
+
4
−
4
View file @
e310e129
...
...
@@ -19,7 +19,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase {
'description'
=>
'Longish description of the example search form'
,
'class_name'
=>
'CRM_Contact_Form_Search_Custom_Examplez'
,
));
$this
->
assert
Equals
(
0
,
$result
[
'is_error'
],
'In line '
.
__LINE__
);
$this
->
assert
APISuccess
(
$result
);
$this
->
assertEquals
(
1
,
$result
[
'count'
],
'In line '
.
__LINE__
);
$entityId
=
$result
[
'id'
];
$this
->
assertTrue
(
is_numeric
(
$entityId
),
'In line '
.
__LINE__
);
...
...
@@ -36,7 +36,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase {
'id'
=>
$entityId
,
'is_active'
=>
0
,
));
$this
->
assert
Equals
(
0
,
$result
[
'is_error'
],
'In line '
.
__LINE__
);
$this
->
assert
APISuccess
(
$result
);
$this
->
assertEquals
(
1
,
$result
[
'count'
],
'In line '
.
__LINE__
);
$this
->
assertDBQuery
(
1
,
'SELECT count(*) FROM civicrm_option_value
WHERE name = "CRM_Contact_Form_Search_Custom_Examplez"
...
...
@@ -51,7 +51,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase {
'id'
=>
$entityId
,
'is_active'
=>
1
,
));
$this
->
assert
Equals
(
0
,
$result
[
'is_error'
],
'In line '
.
__LINE__
);
$this
->
assert
APISuccess
(
$result
);
$this
->
assertEquals
(
1
,
$result
[
'count'
],
'In line '
.
__LINE__
);
$this
->
assertDBQuery
(
1
,
'SELECT count(*) FROM civicrm_option_value
WHERE name = "CRM_Contact_Form_Search_Custom_Examplez"
...
...
@@ -64,7 +64,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase {
'version'
=>
$this
->
_apiversion
,
'id'
=>
$entityId
,
));
$this
->
assert
Equals
(
0
,
$result
[
'is_error'
],
'In line '
.
__LINE__
);
$this
->
assert
APISuccess
(
$result
);
$this
->
assertEquals
(
1
,
$result
[
'count'
],
'In line '
.
__LINE__
);
$this
->
assertDBQuery
(
0
,
'SELECT count(*) FROM civicrm_option_value
WHERE name = "CRM_Contact_Form_Search_Custom_Examplez"
...
...
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