Skip to content

Commit b7a78b4

Browse files
committed
fix(formanswer): bad sql
Signed-off-by: Thierry Bugier <[email protected]>
1 parent ed41631 commit b7a78b4

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
@@ -109,8 +109,12 @@ function plugin_formcreator_getCondition($itemtype) {
109109
if (count($groups) < 1) {
110110
$condition .= ")";
111111
} else {
112-
$groups = implode(',', $groups);
113-
$condition .= " OR `$table`.`groups_id_validator` IN ($groups) )";
112+
$groupIDs = [];
113+
foreach ($groups as $group) {
114+
$groupIDs[] = $group['id'];
115+
}
116+
$groupIDs = implode(',', $groupIDs);
117+
$condition .= " OR `$table`.`groups_id_validator` IN ($groupIDs) )";
114118
}
115119
return $condition;
116120
}

0 commit comments

Comments
 (0)