Skip to content

Commit

Permalink
Merge pull request #12551 from seamuslee001/missed_54_commits
Browse files Browse the repository at this point in the history
Included missed 5.3 commits
  • Loading branch information
eileenmcnaughton authored Jul 24, 2018
2 parents 5df149c + babf3ee commit 0113555
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CRM/Core/BAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ public static function getTree(
$in = "'$entityType'";
}

$params = array();
$sqlParamKey = 1;
if (!empty($subTypes)) {
foreach ($subTypes as $key => $subType) {
$subTypeClauses[] = self::whereListHas("civicrm_custom_group.extends_entity_column_value", self::validateSubTypeByEntity($entityType, $subType));
Expand All @@ -492,7 +494,9 @@ public static function getTree(
AND $subTypeClause
";
if ($subName) {
$strWhere .= " AND civicrm_custom_group.extends_entity_column_id = {$subName} ";
$strWhere .= " AND civicrm_custom_group.extends_entity_column_id = %{$sqlParamKey}";
$params[$sqlParamKey] = array($subName, 'String');
$sqlParamKey = $sqlParamKey + 1;
}
}
else {
Expand All @@ -506,11 +510,10 @@ public static function getTree(
}
}

$params = array();
if ($groupID > 0) {
// since we want a specific group id we add it to the where clause
$strWhere .= " AND civicrm_custom_group.id = %1";
$params[1] = array($groupID, 'Integer');
$strWhere .= " AND civicrm_custom_group.id = %{$sqlParamKey}";
$params[$sqlParamKey] = array($groupID, 'Integer');
}
elseif (!$groupID) {
// since groupID is false we need to show all Inline groups
Expand Down

0 comments on commit 0113555

Please sign in to comment.