Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Development
Core
Commits
a99b82c5
Commit
a99b82c5
authored
Jan 15, 2019
by
eileen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mishandling / loss of check_permission flag
parent
1876e376
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
CRM/Dedupe/Finder.php
CRM/Dedupe/Finder.php
+2
-2
tests/phpunit/api/v3/ACLPermissionTest.php
tests/phpunit/api/v3/ACLPermissionTest.php
+1
-3
No files found.
CRM/Dedupe/Finder.php
View file @
a99b82c5
...
...
@@ -125,6 +125,7 @@ class CRM_Dedupe_Finder {
if
(
!
$params
)
{
return
array
();
}
$checkPermission
=
CRM_Utils_Array
::
value
(
'check_permission'
,
$params
,
TRUE
);
// This may no longer be required - see https://github.com/civicrm/civicrm-core/pull/13176
$params
=
array_filter
(
$params
);
...
...
@@ -146,7 +147,6 @@ class CRM_Dedupe_Finder {
CRM_Core_Error
::
fatal
(
"
$used
rule for
$ctype
does not exist"
);
}
}
$params
[
'check_permission'
]
=
CRM_Utils_Array
::
value
(
'check_permission'
,
$params
,
TRUE
);
if
(
isset
(
$params
[
'civicrm_phone'
][
'phone_numeric'
]))
{
$orig
=
$params
[
'civicrm_phone'
][
'phone_numeric'
];
...
...
@@ -155,7 +155,7 @@ class CRM_Dedupe_Finder {
$rgBao
->
params
=
$params
;
$rgBao
->
fillTable
();
$dao
=
new
CRM_Core_DAO
();
$dao
->
query
(
$rgBao
->
thresholdQuery
(
$
params
[
'
check
_p
ermission
'
]
));
$dao
->
query
(
$rgBao
->
thresholdQuery
(
$check
P
ermission
));
$dupes
=
array
();
while
(
$dao
->
fetch
())
{
if
(
isset
(
$dao
->
id
)
&&
$dao
->
id
)
{
...
...
tests/phpunit/api/v3/ACLPermissionTest.php
View file @
a99b82c5
...
...
@@ -692,9 +692,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase {
],
'check_permissions'
=>
0
,
]);
// Actually this should be 2 but there is a line of array_filter in dupesByParams that causes
// check_permissions to be dropped at that point. I am working aginst rc now - that should possibly be removed against master.
$this
->
assertEquals
(
1
,
$dupes
[
'count'
]);
$this
->
assertEquals
(
2
,
$dupes
[
'count'
]);
CRM_Core_Config
::
singleton
()
->
userPermissionClass
->
permissions
=
[
'administer CiviCRM'
];
$dupes
=
$this
->
callAPISuccess
(
'Contact'
,
'duplicatecheck'
,
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment