Closed helloDanuk closed 8 months ago
I can confirm that this issue still exists and is not only related to the control panel.
Calling \Statamic\Assets\Asset->delete('file/in/a/subdirectory/.meta/filename.yaml')
does not delete the file either.
Running unlink('file/in/a/subdirectory/.meta/filename.yaml')
in eg. Tinkerwell deletes it immediately.
Only tested on my local Mac atm.
Here is my setup:
Environment
Application Name: MAN | CTS
Laravel Version: 10.28.0
PHP Version: 8.2.11
Composer Version: 2.6.5
Environment: local
Debug Mode: ENABLED
URL: statamic-man-cts.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Livewire
Livewire: v3.0.8
Statamic
Addons: 2
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.28.0 PRO
Statamic Addons
jonassiewertsen/statamic-livewire: 3.0.0
marcorieser/statamic-vitals: 1.1.0
It looks like the file does actually get deleted, but immediately re-created.
Seems to be in Asset@resolvePendingMetaOriginalValues()
when getOriginal()
is called inside UpdateAssetReferences
.
Bug description
Deleting assets in your local assets container via CP won't delete the corresponding .meta yaml files if the assets are stored in subfolders. Only .meta files form assets in your root will be deleted. Take a look at this example with one subfolder and two images.
before deleting:
after deleting
The meta yaml from the asset in the subfolder gets some changes though. It's no difference if you delete the asset with or without an alt-text set. Without alt text you just would have the line
data: { }
left after deleting.How to reproduce
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
regex (default)
Additional details
No response