statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

I Should not be able to delete an asset that is linked to an entry. Or at least get a warning #998

Open maxi032 opened 1 year ago

maxi032 commented 1 year ago

Bug description

I've made some assets containers and added a media field in my blueprint. I think that once I've uploaded an asset to an entry, I should not be able to delete that asset via cpanel/assets. Or at least I should get a warning that the photo is used in an entry? Otherwise content managers could delete photos by mistake.

I am using statamic with collections stored in db but blueprints statically.

How to reproduce

Attach a foto to an entry from a collection, then, delete that photo via Assets

Logs

No response

Environment

Environment
Application Name: statamic
Laravel Version: 9.52.7
PHP Version: 8.2.4
Composer Version: 2.5.5
Environment: local
Debug Mode: ENABLED
URL: statamic.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: array
Database: mysql
Logs: stack / daily
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 4
Antlers: runtime
Stache Watcher: Disabled
Static Caching: Disabled
Version: 3.4.11 PRO

Statamic Addons
aryehraber/statamic-impersonator: 2.5.0
spatie/statamic-responsive-images: 3.1.3
statamic/eloquent-driver: 1.2.0
withcandour/aardvark-seo: 2.0.30

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

No response