Skip to content

Commit

Permalink
fix(formanswer): bad sql
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Oct 11, 2019
1 parent 6169412 commit 023a60e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hook.php
Expand Up @@ -111,8 +111,12 @@ function plugin_formcreator_getCondition($itemtype) {
if (count($groups) < 1) {
$condition .= ")";
} else {
$groups = implode(',', $groups);
$condition .= " OR `$table`.`groups_id_validator` IN ($groups) )";
$groupIDs = [];
foreach ($groups as $group) {
$groupIDs[] = $group['id'];
}
$groupIDs = implode(',', $groupIDs);
$condition .= " OR `$table`.`groups_id_validator` IN ($groupIDs) )";
}
return $condition;
}
Expand Down

0 comments on commit 023a60e

Please sign in to comment.