Skip to content

Commit 023a60e

Browse files
committed
fix(formanswer): bad sql
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 6169412 commit 023a60e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hook.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ function plugin_formcreator_getCondition($itemtype) {
111111
if (count($groups) < 1) {
112112
$condition .= ")";
113113
} else {
114-
$groups = implode(',', $groups);
115-
$condition .= " OR `$table`.`groups_id_validator` IN ($groups) )";
114+
$groupIDs = [];
115+
foreach ($groups as $group) {
116+
$groupIDs[] = $group['id'];
117+
}
118+
$groupIDs = implode(',', $groupIDs);
119+
$condition .= " OR `$table`.`groups_id_validator` IN ($groupIDs) )";
116120
}
117121
return $condition;
118122
}

0 commit comments

Comments
 (0)