cms icon indicating copy to clipboard operation
cms copied to clipboard

[5.x] Fix bug {{ collection:previous|next }} in collection with date and time enabled

Open liucf opened this issue 9 months ago • 4 comments

fixed https://github.com/statamic/cms/issues/11263

liucf avatar Apr 07 '25 08:04 liucf

Would you be able to add a test for this fix? We have tests for the collection:previous/next tags in CollectionTest.

duncanmcclean avatar Apr 07 '25 09:04 duncanmcclean

@duncanmcclean Added test. This bug only occurs when using 'driver' => 'file'. The test suite runs with SQLite, which uses the 'eloquent' driver, so it doesn't catch this bug.

However, when testing it manually through the browser with the 'file' driver, this PR does fix the issue.

liucf avatar Apr 07 '25 11:04 liucf

Thanks!

duncanmcclean avatar Apr 07 '25 11:04 duncanmcclean

I think this looks good, but since it's a change in the base query builder class, this would potentially effect much more than just the collection:next/prev tag so I want to do a little more testing.

jasonvarga avatar Apr 22 '25 18:04 jasonvarga