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

buggy {{ collection:previous|next }} in collection with date and time enabled #11263

Open
jimblue opened this issue Dec 16, 2024 · 4 comments
Open

Comments

@jimblue
Copy link
Contributor

jimblue commented Dec 16, 2024

Bug description

The {{ collection:previous}} and {{ collection:next }} don’t return the correct entry.
It appends to collections with time and date enabled when entry have same date (but different time).

How to reproduce

It's a really weird problem. My guess is a problem with collection sorting that is mixing date and title, but I'm not sure.
To make it easier to understand, I've created a reproduction repo : https://github.com/jimblue/statamic-buggy-nav

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.35.1
PHP Version: 8.3.14
Composer Version: 2.8.4
Environment: local
Debug Mode: ENABLED
URL: statamic.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: log
Queue: sync
Session: file

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

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@jimblue jimblue changed the title buggy {{ collection:previous|next }} in collection with date and time enabled buggy {{ collection:previous|next }} to collection with date and time enabled Dec 16, 2024
@jimblue jimblue changed the title buggy {{ collection:previous|next }} to collection with date and time enabled buggy {{ collection:previous|next }} in collection with date and time enabled Dec 16, 2024
@jimblue
Copy link
Contributor Author

jimblue commented Dec 16, 2024

Screen.Recording.2024-12-16.at.23.35.55.mov

@duncanmcclean
Copy link
Member

Can you try sorting by the title as well?

{{ collection:previous in="blog" as="posts" limit="1" sort="date:asc|title:asc" }}

@jimblue
Copy link
Contributor Author

jimblue commented Dec 17, 2024

Nope, still buggy. (I've added the modification on the reproduction repo here if you want to try)

@jimblue
Copy link
Contributor Author

jimblue commented Dec 19, 2024

Still needs more info?

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

No branches or pull requests

2 participants