Skip to content

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

@ondrejpazourekdek

Description

@ondrejpazourekdek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions