statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
108 stars 76 forks source link

Asset meta data will not be updated when file is moved #70

Closed leganz closed 1 year ago

leganz commented 2 years ago

Issue

Moving an asset into different folder results in a duplicate entry + missing the meta data.

CleanShot 2022-10-07 at 15 23 31@2x

ryanmitchell commented 2 years ago

We probably need to bring some of this method over to the Eloquent Asset class: https://github.com/statamic/cms/blob/c09bbd0f5eb5eec3615e81532da0e08b8aea0e9b/src/Assets/Asset.php#L655-L680

Or at least cache the old metaPath, call the parent method, then update the meta value based on the old one (and remove it).

Is this something you would be prepared to work on?

leganz commented 2 years ago

The same issue also seems to occur for renaming btw