Image Id is not set to zero after avatar is deleted. #3457

Closed
opened 2026-02-05 06:46:55 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @ondrejpazourekdek on GitHub (Jan 16, 2023).

Describe the Bug

After resetting the avatar should be in the table image_id set to 0.

// BookStack\Http\Controllers\UserController
if ($request->has('profile_image_reset')) {
    $this->imageRepo->destroyImage($user->avatar);
    $user->image_id = 0; // added
    $user->save(); // added
}

Steps to Reproduce

Delete the avatar and check the users table.

Expected Behaviour

Zero in column image_id

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

22.11.1

PHP Version

No response

Hosting Environment

does not matter

Originally created by @ondrejpazourekdek on GitHub (Jan 16, 2023). ### Describe the Bug After resetting the avatar should be in the table image_id set to 0. ``` // BookStack\Http\Controllers\UserController if ($request->has('profile_image_reset')) { $this->imageRepo->destroyImage($user->avatar); $user->image_id = 0; // added $user->save(); // added } ``` ### Steps to Reproduce Delete the avatar and check the users table. ### Expected Behaviour Zero in column image_id ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version 22.11.1 ### PHP Version _No response_ ### Hosting Environment does not matter
OVERLORD added the 🐛 Bug label 2026-02-05 06:46:55 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2023):

Thanks for reporting @ondrej-pazourek,
this has been addressed in 03ad288aaa, and will be part of the next feature release.

@ssddanbrown commented on GitHub (Jan 26, 2023): Thanks for reporting @ondrej-pazourek, this has been addressed in 03ad288aaa55a0bd0aa143711aa07d0f1801d604, and will be part of the next feature release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3457