Problem/Motivation

Usage is removed even if the usage override ("force delete") was not specified.

Steps to reproduce

Attempt to delete a file with usage and do not use the "force" override. The file is not deleted, which is appropriate. However, the usage is deleted, which is not.

Proposed resolution

Don't delete usage unless the "force" option is set.

Remaining tasks

Provide a patch / MR.

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 file_delete-3515351-2.patch2.24 KBjohn.oltman
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

john.oltman created an issue. See original summary.

john.oltman’s picture

StatusFileSize
new2.24 KB
hartsak’s picture

I encountered the same issue too when I updated file_delete to 3.0.0

The file usage was removed even though there was the error about the file being used. I didn't force remove the file nor did I have the permission to override it.
When I went back to 2.x the safeguard seems to work as it should because the file usage was not removed in the same situation.

Any idea what might be wrong?

o_timoshchuk’s picture

Status: Active » Reviewed & tested by the community

I have tested the patch, and it works for me

o_timoshchuk’s picture

Assigned: Unassigned » o_timoshchuk

o_timoshchuk’s picture

Assigned: o_timoshchuk » Unassigned

The merge request with the fix has been prepared

  • adcf0086 committed on 3.0.x
    refs #3515351: Fixes an issue with deleting a file in use.
    
smustgrave’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

usmanjutt84’s picture

Status: Fixed » Closed (fixed)

The `Fixed` status means it's still `Open`. Since it's already fixed and merged, marking it `Closed (Fixed)` .

smustgrave’s picture

Actually that’s not correct. Fixed does not mean still open. And it moves to closed after 2 weeks

usmanjutt84’s picture

I am sorry - I just re-read the documentation and 100% agree with you. Thanks