Skip to content

Commit

Permalink
fix: SQL error when inconsistency in DB
Browse files Browse the repository at this point in the history
if a user is linked to a not existing group, a SQL IN statement begins with a comma

fix #3242
  • Loading branch information
btry committed Apr 19, 2023
1 parent 7df2f7a commit 1af7872
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ function plugin_formcreator_addDefaultWhere($itemtype) {

$groupIDs = [];
foreach ($groups as $group) {
if ($group['id'] === null) {
continue;
}
$groupIDs[] = $group['id'];
}
$groupIDs = implode(',', $groupIDs);
Expand Down

0 comments on commit 1af7872

Please sign in to comment.