Skip to content

500 error from duplicate ID in collection tree following reorder of entries #11209

@wesort

Description

@wesort

Bug description

Reordering a new entry causes a duplicate ID in the collection tree.

Similar to #2662 (closed) and #9531 (open).

How to reproduce

NB: I'm struggling to recreate this in my dev env. The client has managed to cause the issue a couple of times but not entirely sure what is triggering it.

Steps:

  • Create a new entry in an orderable collection and publish it.
  • Reorder the entries and save.
  • Result: 500 error on front-end that doesn't use custom error template

Only certain users seem to cause this issue:

  • Their preferences & permissions are the same apart from collection listing columns being displayed
  • Users on Windows 11 using Chrome.
  • Workaround seems to be: refresh the collection listing (ie: cmd + r in the browser) after publishing the new entry but before reordering.

Logs

No response

Environment

Environment
Application Name: Red + White
Laravel Version: 11.34.1
PHP Version: 8.3.13
Composer Version: 2.8.3
Environment: production
Debug Mode: OFF
URL: redandwhite.co
Maintenance Mode: OFF
Timezone: UTC
Locale: en

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

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

Statamic
Addons: 1
Sites: 1
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.40.0 PRO

Statamic Addons
jacksleight/statamic-bard-mutator: 3.0.3

Installation

Fresh statamic/statamic site via CLI

Additional details

Further context:

  • List of entries in the tree includes a duplicate ID at the end after using Reorder button in the CP.
  • Results in 500 error on the front-end (see below)
    • NB: APP_DEBUG=false so I presume the custom error template /resources/views/errors/500.blade.php should be presented instead?
  • Results in Server error in CP listing for that collection but no further info
  • The duplicate ID CP page doesn't appear. I presume as it's not a duplicate entry in the collection, but a duplicate entry in the tree.
  • The position of the newly created entry seems random. Sometimes it's at the top of the listing (desired) and sometimes at the bottom.

front-end error screenshot

Screenshot 2024-12-02 14 10 33

CP error screenshot

Screenshot 2024-12-02 14 09 17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions