Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a media only deletes the file, not the associated folder on S3 #1543

Open
ziming opened this issue Aug 27, 2019 · 2 comments

Comments

@ziming
Copy link
Contributor

commented Aug 27, 2019

Hi,

According to the docs, it says:

When a Media-object gets deleted the package will delete its entire associated directory. To avoid tears or worse, make sure that every media gets stored its own unique directory.

I tried it (my filesystems is S3) and what happens is only the file get deleted. the associated id folder doesn't get deleted. It becomes an empty folder instead (i.e. folder 123 for media id 123 still exist but empty)

What did I do wrong?

Thank you.

@freekmurze

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

I think this is a bug, i'd accept a PR that fixes this.

@Gummibeer

This comment has been minimized.

Copy link
Contributor

commented Aug 27, 2019

The same issue is on Azure - I beliefe that this is related to the blob-storage and that they don't know directories but Filesystem::getMediaDirectory() creates the directory - in blob storages this will result in a normal blob.

The error is here that it only excludes the driver name if it's s3. So it doesn't exclude by the driver or does it exclude other blob storages.

if (! in_array($media->getDiskDriverName(), ['s3'], true)) {
$this->filesystem->disk($media->disk)->makeDirectory($directory);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.