cms icon indicating copy to clipboard operation
cms copied to clipboard

Reordering collection of a collection in CP reverses order unexpectedly

Open lukeagsmith opened this issue 5 months ago • 1 comments

Bug description

A descending collection switches order to ascending when you click reorder and then switches back again on save.

This doesn't actually break the order but leads the user to think it's broken and is causing confusion.

A couple of clients has reported this and one user just spend time manually reversing and 100+ collection as they thought it had gone wrong!

I think this actually what is being described here by @DanielDarrenJones - although I can't see the Loom any more - it isn't just related to a dated collection as @duncanmcclean suggests.

The expected behaviour is the order should stay the same between the list view and reorder view.

How to reproduce

  • Have a collection
  • Make it orderable
  • Set direction to descending
  • Set max depth to 1 (not tested with other depths)
  • Press Reorder and the entires become ascending
  • Press Save Order become descending

Logs


Environment

Environment
Application Name: Foo
Laravel Version: 12.16.0
PHP Version: 8.3.22
Composer Version: 2.8.9
Environment: local
Debug Mode: ENABLED
URL: bm.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.56.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

lukeagsmith avatar Jun 16 '25 12:06 lukeagsmith

We actually do this on purpose, see #10797.

We need to remove any filters or sorting you have in place, otherwise you might end up reordering only a subset of your collection which often isn't what you want.

Maybe we can improve the UX around it though 🤔

duncanmcclean avatar Jun 16 '25 13:06 duncanmcclean