fix(ui): list relationship cell shows (Untitled) for draft-only titles - #16979
Merged
Conversation
The list view relationship/upload cell loaded related docs through RelationshipProvider without the draft parameter, so Payload returned the published main-collection row. For documents whose title only exists in a draft (the value lives in the versions table), this rendered "(Untitled)". Request the related docs with draft=true to match the edit view relationship field, so the list column shows the same title.
GermanJablo
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
June 12, 2026 11:40
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
Adds an e2e test reproducing #16977: a related doc whose title only exists in a draft rendered "(Untitled)" in the list view relationship cell. The test fails without the draft=true fix in RelationshipProvider.
JarrodMFlesch
approved these changes
Jun 12, 2026
Contributor
|
🚀 This is included in version v3.85.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #16977
The list view relationship/upload cell loads related docs through
RelationshipProvider, which requestedGET /api/<slug>?depth=0&select[<useAsTitle>]=truewith nodraftparameter, so Payload returned the published/main-collection row.Because draft-only edits are written only to the versions table (the main row is updated only on first create and on publish), the list cell read a stale/empty title and rendered "(Untitled)", while the edit-view relationship field (which loads options with
draft: true) rendered the real title. This is especially visible with autosave.This PR requests the related docs with
draft=trueinRelationshipProvider, matching the edit-view relationship field, so the list column shows the same title.How
draft=trueto the request made bypackages/ui/src/elements/Table/RelationshipProvider/index.tsx.Tests
Added an e2e test in
test/fields-relationship/e2e.spec.ts(should show draft-only title for related doc in list view cell) that:Without the fix the test fails because the cell renders "(Untitled)":
The dev server log for that failing run confirms the root cause: the request omits the
draftparam.With the fix applied the request includes
draft=trueand the test passes.Notes
A companion PR targets
mainwith the same fix.