Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wesort opened this issue Dec 2, 2024 · 1 comment
Open

Comments

@wesort
Copy link
Contributor

wesort commented Dec 2, 2024

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

@wesort
Copy link
Contributor Author

wesort commented Dec 2, 2024

Update: I think this is due to the user's choice with the number of entries to include in the pagination in the CP. Users that cause the issue have this set to 50 (default) and there are more than 50 entries in the collection. Changing 100 fixes it.

preferences:
  collections:
    projects:
      per_page: 100

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants