1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Updated user avatar reset to clear relation id in database

Added test to cover.
For #3977
This commit is contained in:
Dan Brown
2023-01-26 17:15:09 +00:00
parent 811be3a36a
commit 03ad288aaa
3 changed files with 35 additions and 1 deletions

View File

@ -164,6 +164,8 @@ class UserController extends Controller
// Delete the profile image if reset option is in request
if ($request->has('profile_image_reset')) {
$this->imageRepo->destroyImage($user->avatar);
$user->image_id = 0;
$user->save();
}
$redirectUrl = userCan('users-manage') ? '/settings/users' : "/settings/users/{$user->id}";