Conversation
…eholder admin.listSearchableFields accepts a dotted path, and mergeListSearchAndWhere queries it correctly, but getTextFieldsToBeSearched matched the configured strings against the bare field.name. A path like items.value matched nothing, so the placeholder fell back to the title field and read "Search by ID" while the search was really matching the array subfield. flattenTopLevelFields records the dotted path it builds on accessor, but it does not descend into arrays, so array subfields were not in the list at all. Walk arrays here as well and match on the path. The bare name is still matched for everything that was already reachable, so configs naming a hoisted group or tab subfield directly keep working. Array subfields are matched by path only, since their bare name is not a valid query path and would put the placeholder back to claiming something untrue.
Minhal128
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
September 17, 2026 19:30
This branch has not been deployed
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?
With
admin.listSearchableFieldsset to a dotted path, the list view's search box says "Search by ID" while the search actually matches the field you configured.Typing filters the rows correctly; the placeholder still claims it searches the row id. The real-world case is
form-submissionsfrom@payloadcms/plugin-form-builderwithlistSearchableFields: ['submissionData.value'].Why?
The search works because
mergeListSearchAndWheremaps each configured string straight to{ [path]: { like: search } }, and a dotted path is a valid query path.The placeholder is built from
getTextFieldsToBeSearched, which matched the configured strings against the barefield.name:Two things fall out of that:
flattenTopLevelFields(fields, { moveSubFieldsToTop: true })records the dotted path it builds onaccessor, but the match ignored it — so'meta.description'did not resolve either, even though that field is in the flattened list.items.valuewas not in the list at all.Nothing matched,
listSearchableFieldscame back empty, andListControlsfell through tosearchLabel, which defaults to'ID'.How?
Walk arrays alongside what
flattenTopLevelFieldsalready hoists, and match on the path.The bare name is still matched for everything that was reachable before, so a config naming a hoisted group or tab subfield directly (
['description']) keeps working. Array subfields are matched by path only — their bare name is not a valid query path, so matching it would just put the placeholder back to naming a field the search does not actually use.Added
getTextFieldsToBeSearched.spec.ts: the array path, the group path, a plain top-level name, a group subfield by bare name, several paths at once, an array subfield not matching by bare name, no match, and theundefinedconfig.Targeting
3.xOn
mainthe placeholder is a plain "Search" andpackages/ui/src/elements/ListControls/getTextFieldsToBeSearched.tsno longer exists, so this is a v3-only bug and a bug fix only — which is what the template says3.xtakes.Fixes #18201
Written with Claude Code, which this repo ships configuration for. What I verified and what I did not: I read
getTextFieldsToBeSearched,flattenTopLevelFields, and the placeholder block inListControls/index.tsxon3.x, and checked the matching logic against the spec's fixtures by hand. I have not run the test suite or the admin UI locally, so a run ofpackages/uiwould be worth having before merge.