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 16 TypeScript

fix: find afterRead hooks should behave like findByID (#15357)

## Issue
Fixes `find` afterRead operations that should behave like `findByID`
afterRead hooks do.

## Before
The find afterRead hooks were falling back to the `doc` if the hook
returned undefined/null.

## After
The find afterRead hooks now fallback to the `docRef` if the afterRead
hook returns undefined/null.

## Alignment
You can see
[here](https://github.com/payloadcms/payload/blob/main/packages/payload/src/collections/operations/findByID.ts#L310-L319)
that the findByID already behaves this way.
J
Jarrod Flesch committed
3e271556d3d5d4245ccffc5c8f0e4beabb5d7ef5
Parent: dfc1600
Committed by GitHub <noreply@github.com> on 1/26/2026, 6:31:53 PM