Skip to content

Commit

Permalink
Fix for grouping by a multi-select join (checkbox).
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Jan 11, 2016
1 parent ab91647 commit 26524b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/com_fabrik/models/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2829,6 +2829,7 @@ public function buildQueryOrder($query = false)

if ($groupBy !== '')
{
$groupByEl = $this->getGroupByElement();
$strOrder == '' ? $strOrder = "\n ORDER BY " : $strOrder .= ',';
$strOrder .= FabrikString::safeColName($groupBy) . ' ASC';
$this->orderEls[] = $groupBy;
Expand Down Expand Up @@ -3718,9 +3719,12 @@ protected function &getAsFields($mode = 'list')

if (!in_array($longGroupBy, $this->fields) && trim($longGroupBy) != '')
{
$this->asfields[] = FabrikString::safeColName($longGroupBy) . ' AS ' . $longGroupBy;
$this->fields = $longGroupBy;
$this->group_by_added = true;
if (!in_array(FabrikString::safeColName($longGroupBy), $this->fields))
{
$this->asfields[] = FabrikString::safeColName($longGroupBy) . ' AS ' . $longGroupBy;
$this->fields = $longGroupBy;
$this->group_by_added = true;
}
}

return $this->asfields;
Expand Down

0 comments on commit 26524b9

Please sign in to comment.