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
bbb0539f
Unverified
Commit
bbb0539f
authored
4 years ago
by
colemanw
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #18498 from eileenmcnaughton/opennp
#2039
Fix OpenID::add to ensure is_primary is set
parents
f7ca027c
a725865d
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
CRM/Core/BAO/OpenID.php
+8
-0
8 additions, 0 deletions
CRM/Core/BAO/OpenID.php
tests/phpunit/api/v3/OpenIDTest.php
+7
-0
7 additions, 0 deletions
tests/phpunit/api/v3/OpenIDTest.php
with
15 additions
and
0 deletions
CRM/Core/BAO/OpenID.php
+
8
−
0
View file @
bbb0539f
...
...
@@ -24,9 +24,16 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID {
* Create or update OpenID record.
*
* @param array $params
*
* @return CRM_Core_DAO_OpenID
*
* @throws \API_Exception
* @throws \CRM_Core_Exception
*/
public
static
function
add
(
$params
)
{
if
(
empty
(
$params
[
'id'
])
||
is_numeric
(
$params
[
'is_primary'
]
??
NULL
))
{
CRM_Core_BAO_Block
::
handlePrimary
(
$params
,
__CLASS__
);
}
return
self
::
writeRecord
(
$params
);
}
...
...
@@ -38,6 +45,7 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID {
* Input parameters to find object.
*
* @return mixed
* @throws \CRM_Core_Exception
*/
public
static
function
&
getValues
(
$entityBlock
)
{
return
CRM_Core_BAO_Block
::
getValues
(
'openid'
,
$entityBlock
);
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/api/v3/OpenIDTest.php
+
7
−
0
View file @
bbb0539f
...
...
@@ -18,6 +18,13 @@
*/
class
api_v3_OpenIDTest
extends
CiviUnitTestCase
{
/**
* Should location types be checked to ensure primary addresses are correctly assigned after each test.
*
* @var bool
*/
protected
$isLocationTypesOnPostAssert
=
TRUE
;
protected
$_params
;
protected
$id
;
protected
$_entity
;
...
...
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