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>
btry committed Oct 11, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ed41631 commit b7a78b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hook.php
Original file line number Diff line number Diff line change
@@ -109,8 +109,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;
}

0 comments on commit b7a78b4

Please sign in to comment.