Skip to content

Commit

Permalink
Fix permissions migration causing errors for user group permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Mar 31, 2020
1 parent 930289a commit 1640b62
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/migrations/m200119_000000_permissions_uid.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ public function safeUp()

if (is_array($permissions)) {
foreach ($permissions as $permission) {
$newPermissions[] = Db::uidById(Table::USERGROUPS, $permission);
try {
$newPermission = Db::uidById(Table::USERGROUPS, (int)$permission) ?? '';

if ($newPermission) {
$newPermissions[] = $newPermission;
}
} catch (\Throwable $e) {
continue;
}
}
}

Expand Down

0 comments on commit 1640b62

Please sign in to comment.