-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
area: asset-managementarea: media-librarytype: bugcode to address defects in shipped codecode to address defects in shipped code
Description
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
- 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'
- Create a post with an uploaded image
- Delete the post
- 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
nhoizey and adrian5
Metadata
Metadata
Assignees
Labels
area: asset-managementarea: media-librarytype: bugcode to address defects in shipped codecode to address defects in shipped code