SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

0 0 484 TypeScript

fix: `select` in `findByID` with `draft: true` may return a wrong version (#14742)

Fixes https://github.com/payloadcms/payload/issues/14589
This was caused by the fact that our `replacwWithDraftIfAvailable`
function expects to have `createdAt` and `updatedAt` fields and when the
user doesn't select `createdAt` and `updatedAt` fields the logic breaks.
Now, specifically for this case we force to select those fields,
however, you still won't receive `createdAt` and `updatedAt` fields to
the final result if they weren't specified in `select`.

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
S
Sasha committed
49c9fa9757eff4b9fdb2abb2e70d97829406b77a
Parent: d77af00
Committed by GitHub <noreply@github.com> on 1/16/2026, 6:45:09 PM