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

Images uploaded in a collection sub media_folder aren't deleted when they should #6642

Open
Oreilles opened this issue Jan 6, 2023 · 2 comments
Labels
area: asset-management area: media-library type: bug code to address defects in shipped code

Comments

@Oreilles
Copy link

Oreilles commented Jan 6, 2023

When a media_folder and public_folder are used for a specific collection, the uploaded images for that collection aren't deleted when a collection item is deleted.

To Reproduce

  1. Use the following config:
collections:
  - name: posts
    label: Posts
    label_singular: 'Post'
    folder: content/posts
    path: '{{slug}}/index'
    media_folder: ''
    public_folder: ''
    fields:
      - label: Title
        name: title
        widget: string
      - label: 'Cover Image'
        name: 'image'
        widget: 'image'
  1. Create a post with an uploaded image
  2. Delete the post
  3. The index.md file is deleted, but the containing folder, including the uploaded image, are preserved.

Expected behavior
The image and folder structure of the post should be deleted too, since the image can't be referenced by other posts or any other collection items (See #5910). For the same reason they can't be referenced everywhere else, they also cannot be deleted from anywhere else in netlify-cms.

Applicable Versions:

  • Netlify CMS version: 2.15.72
  • Git provider: Gitlab
  • OS: macOS
  • Browser version: Firefox 108.0.1
@Oreilles Oreilles added the type: bug code to address defects in shipped code label Jan 6, 2023
@Armughan35
Copy link

i am uploading the image and description from cms but it is not showing in the wensite what is reason behind it

@stale
Copy link

stale bot commented Apr 26, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: asset-management area: media-library type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants