Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing main element select query for backend element list

  • Loading branch information...
commit c268425ed0f704f124a57cef6b9f923104576cb9 1 parent e1c63b4
@cheesegrits cheesegrits authored committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 administrator/components/com_fabrik/models/elements.php
View
10 administrator/components/com_fabrik/models/elements.php
@@ -93,6 +93,14 @@ protected function getListQuery()
$this->filterByFormQuery($query, 'fg');
// Join over the users for the checked out user.
+
+ // $$$ hugh - altered this query as ...
+ // WHERE (jj.list_id != 0 AND jj.element_id = 0)
+ // ...instead of ...
+ // WHERE jj.list_id != 0
+ //... otherwioe we pick up repeat elements, as they have both table and element set
+ // and he query fails with "returns multiple values" for the fullname select
+
$fullname = "(SELECT DISTINCT(
IF( ISNULL(jj.table_join), CONCAT(ll.db_table_name, '___', ee.name), CONCAT(jj.table_join, '___', ee.name))
)
@@ -100,7 +108,7 @@ protected function getListQuery()
LEFT JOIN #__{package}_joins AS jj ON jj.group_id = ee.group_id
LEFT JOIN #__{package}_formgroup as fg ON fg.group_id = ee.group_id
LEFT JOIN #__{package}_lists AS ll ON ll.form_id = fg.form_id
- WHERE jj.list_id != 0
+ WHERE (jj.list_id != 0 AND jj.element_id = 0)
AND ee.id = e.id AND ee.group_id <> 0 LIMIT 1) AS full_element_name";
$query->select('u.name AS editor, '.$fullname.', g.name AS group_name, l.db_table_name');
Please sign in to comment.
Something went wrong with that request. Please try again.