eloquent-driver icon indicating copy to clipboard operation
eloquent-driver copied to clipboard

Reorder collection does not working

Open enespolat24 opened this issue 3 years ago • 9 comments

Hey, i'm using statamic 3.2.37 with eloquent driver and i'm having this issue https://github.com/statamic/cms/issues/3620

any idea how to solve this ?

enespolat24 avatar Mar 09 '22 12:03 enespolat24

Should be solved by the all models PR

ryanmitchell avatar Mar 15 '22 17:03 ryanmitchell

I have recently switch Statamic to use a database. I have the same issue when trying to reorder a collection. Do you have any update on that issue ? @enespolat24

simonbedard12 avatar Mar 22 '22 15:03 simonbedard12

Sadly no. still looking for a solution

enespolat24 avatar Mar 22 '22 17:03 enespolat24

Can you check this against the new v1? I think this issue can be closed.

ryanmitchell avatar Sep 05 '22 06:09 ryanmitchell

Looks like the entries are being reordered correctly. For example, if you were to output them on the frontend. However in the CP the listing immediately reverts to being sorted by title. This doesn't happen when using a fresh install with the stache driver.

jasonvarga avatar Sep 05 '22 14:09 jasonvarga

I'm able to reproduce and I'm not seeing it re-ordering correctly anywhere, even on the front end.

We'll need to update EntryQueryBuilder to orderBy the order in the tree - so select the tree, get the ids then order by field (but this is MySQL specific).

The other option would be to get all entries then defer to OrderedQueryBuilder... but this means less processing on the database side so its not ideal.

ryanmitchell avatar Sep 05 '22 15:09 ryanmitchell

sorry for the late reply, yes the issue is still present with v1 eloquent-driver

enespolat24 avatar Sep 08 '22 14:09 enespolat24

@enespolat24 see if this PR fixes it... https://github.com/statamic/eloquent-driver/pull/57

ryanmitchell avatar Sep 08 '22 16:09 ryanmitchell

sorry for the late reply, still have issues. when i hit the save button it reverts new order as it was before

enespolat24 avatar Sep 14 '22 13:09 enespolat24