Skip to content

Commit

Permalink
Hacky fix for issue with joins after copying a list.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Oct 29, 2017
1 parent 1ea534d commit 68cfa8b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions components/com_fabrik/models/list.php
Expand Up @@ -4474,6 +4474,23 @@ public function &getJoins()
$query->order('id');
$db->setQuery($query);
$this->joins = $db->loadObjectList();

// make sure list joins comes first, don't ask
usort($this->joins, function($a, $b) {
if ((int)$a->list_id === 0)
{
return 1;
}

if ((int)$b->list_id === 0)
{
return -1;
}


return ((int)$a->list_id < (int)$b->list_id) ? -1 : 1;
});

$this->_makeJoinAliases($this->joins);

foreach ($this->joins as &$join)
Expand Down

0 comments on commit 68cfa8b

Please sign in to comment.