eloquent-driver
eloquent-driver copied to clipboard
Reorder issue.
Bug description
Hey, I've gotten a site for a customer running Statamic 4 and Statamic eloquent driver. The site has been migrated from a Statamic 3 with Statamic eloquent driver.
The problem i really odd. I've got a collection using reorder with a max depth of 1. When i reorder I can see that my database tree is updated but the order on the entries in the database say the same. If i change the max depth to 0 / blank it works as expected.
I do not know if this is an actual bug or if it's a problem that happened during the migration.
How to reproduce
I cannot reproduce it on a fresh install, but hope to get some help either in this thread or through a discord call.
Logs
No response
Environment
Environment
Application Name: *********
Laravel Version: 10.48.12
PHP Version: 8.2.22
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: *********.ddev.site
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: daily
Mail: smtp
Queue: sync
Session: redis
Statamic
Addons: 6
Antlers: runtime
Sites: 2 (Danish, English)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 4.58.2 PRO
Statamic Addons
doublethreedigital/duplicator: 4.0.1
jacksleight/statamic-bard-mutator: 2.3.0
pecotamic/sitemap: 1.4.6
statamic/eloquent-driver: 3.4.1
Statamic Eloquent Driver
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: file
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: file
Navigation Trees: file
Navigations: eloquent
Revisions: eloquent
Taxonomies: file
Terms: eloquent
Additional details
No response
Is there any reason you can't update the site to v5 and the latest eloquent driver version?
@ryanmitchell I've got a version of Statamic 5 running on a development environment, but I experience the same bug with reorder on v5.
You had previously said you dont encounter the error on a fresh install - is this no longer the case?
When i reorder I can see that my database tree is updated but the order on the entries in the database say the same.
can you explain what this means - with some screenshots or examples of the difference in output versus what you were expecting?
@ryanmitchell on a fully fresh Statamic install in the newest version i don't encounter this issue. When i debug the code i can see that my database is updated to the correct order in the "trees" table but that the order on the "entries" table is not updated. It looks like Statamic trying to update the order on the Entries through jobs running via horizon. But this should not be the problem due to the reorder not working in sync mode either. Can we perhaps find a time for a discord call, and i can screen share the issue.
Yes the reordering uses a job. Interesting that it works fine on a new install. Feel free to reach out on discord and we can set something up.
I think https://github.com/statamic/eloquent-driver/pull/377 should solve this. It seems to have not been noticed before as it only happens on queues.
I wanted to check if there are any updates regarding this issue. We’ve also encountered the same problem where reordering is pushed to the queue.
Is there already a solution or a configuration available to resolve this?
Only https://github.com/statamic/eloquent-driver/pull/377 - but I'm not sure its the best solution. I havent been able to reliably recreate the issue.