1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Fixed delete role failing with no migrate role provided

For #4128
This commit is contained in:
Dan Brown
2023-03-25 12:07:59 +00:00
parent 970088a8a1
commit dde38e91b5
2 changed files with 18 additions and 1 deletions

View File

@ -151,7 +151,8 @@ class RoleController extends Controller
$this->checkPermission('user-roles-manage');
try {
$this->permissionsRepo->deleteRole($id, $request->get('migrate_role_id', 0));
$migrateRoleId = intval($request->get('migrate_role_id') ?: "0");
$this->permissionsRepo->deleteRole($id, $migrateRoleId);
} catch (PermissionsException $e) {
$this->showErrorNotification($e->getMessage());