Skip to content

Commit

Permalink
Quote field names in join delete query.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Nov 27, 2017
1 parent 1d50c43 commit cdd4383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/com_fabrik/models/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -7766,11 +7766,11 @@ protected function deleteDeselectedItems($idsToKeep, $k)
foreach ($idsToKeep as $parentId => $ids)
{
$query->clear();
$query->delete($join->table_join)->where('parent_id = ' . $parentId);
$query->delete($join->table_join)->where($db->quoteName('parent_id') . ' = ' . $parentId);

if (!empty($ids))
{
$query->where('id NOT IN ( ' . implode($ids, ',') . ')');
$query->where($db->quoteName('id') . ' NOT IN ( ' . implode($ids, ',') . ')');
}

$db->setQuery($query);
Expand Down

0 comments on commit cdd4383

Please sign in to comment.