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
104 stars 74 forks source link

Moving assets from one folder to another does not work #80

Closed espenlg closed 1 year ago

espenlg commented 1 year ago

When I try to move an asset from one folder to another I get an error. Console logs identifies the problem and it looks like it searches for an actual metafile for the assets.

196404007-897ddbce-bfb6-41df-8d14-17a69b0b4e25

Support details: Statamic 3.3.43 Pro Laravel 8.83.23 PHP 8.0.23 r8edge/imagemap dev-main r8edge/welcome-widget dev-main statamic/eloquent-driver 1.0.1

ryanmitchell commented 1 year ago

Duplicate of: https://github.com/statamic/eloquent-driver/issues/70 Should be fixed by: https://github.com/statamic/eloquent-driver/pull/71

espenlg commented 1 year ago

Should be fixed by: #71

I did try to patch in PR #71 without any luck, but maybe it was a bit early 🤔

ryanmitchell commented 1 year ago

Yeah I can see that now... try this

leganz commented 1 year ago

@ryanmitchell i tested the code you provided. 1) it throws an exception (i mentioned it in the code) 2) i switched it to metaoldPath and the problem still exsits. I can still reproduce it.

ryanmitchell commented 1 year ago

@leganz I've updated the variable. Can't see any reason for it not to be working at this point, but if you want to give me a full error trace and/or access to a sample repository I can certainly look into it further.

leganz commented 1 year ago

I debugged the problem here... its kind of weirrd cause if you move/rename the asset => the writeMeta method will be called 3 times. The first time it has the meta information but the second and last time its gone.

Edit: sry tested it from the #71 angle..

leganz commented 1 year ago

I suggested a change in #71 => that will probably resolve the issue

ryanmitchell commented 1 year ago

Fixed by https://github.com/statamic/eloquent-driver/pull/71