projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73a5a9a
)
APIv4 - Prevent api adding default join conditions when it shouldn't
author
Coleman Watts
<coleman@civicrm.org>
Wed, 7 Apr 2021 20:16:25 +0000
(16:16 -0400)
committer
Coleman Watts
<coleman@civicrm.org>
Wed, 7 Apr 2021 20:16:25 +0000
(16:16 -0400)
When adding an explicit join, the api will search for a default condition unless
an fk field has been explicitly set. This fixes an error when the api thought
no fk field was present when it actually was.
Civi/Api4/Query/Api4SelectQuery.php
patch
|
blob
|
blame
|
history
diff --git
a/Civi/Api4/Query/Api4SelectQuery.php
b/Civi/Api4/Query/Api4SelectQuery.php
index 3a2d80efd3320f2fb66aa918034f7b2e207dc6df..8e42ed2b25e94fb349051d35e1876f00d3b0593d 100644
(file)
--- a/
Civi/Api4/Query/Api4SelectQuery.php
+++ b/
Civi/Api4/Query/Api4SelectQuery.php
@@
-658,7
+658,7
@@
class Api4SelectQuery {
return FALSE;
}
foreach ([$sideA, $sideB] as $expr) {
- if ($expr === "$alias.id" || !empty($joinEntityFields[
"$alias.$expr"
]['fk_entity'])) {
+ if ($expr === "$alias.id" || !empty($joinEntityFields[
str_replace("$alias.", '', $expr)
]['fk_entity'])) {
return TRUE;
}
}