#Duplicate options appearing in relationship filter dropdown in Admin UI

10 messages · Page 1 of 1 (latest)

dapper hamlet
#

Hi,

I'm experiencing a UI issue in the Payload Admin panel where options in a relationship filter dropdown appear duplicated.

Environment:

  • Payload version: 3.79.0
  • Database: Postgres
  • Using @payloadcms/next

Example:
I have a collection called "linhas" with two records:

1 - nova
2 - soft

The API returns the correct data:

GET /api/linhas

{
"docs": [
{ "id": 2, "nome": "soft" },
{ "id": 1, "nome": "nova" }
]
}

However, when I use the filter in the Admin UI for a relationship field (Produtos → filter by "linhas"), the dropdown shows duplicated values, for example:

None
soft
nova
soft
soft

I also noticed that the Admin UI triggers multiple GET requests to /api/linhas.

My relationship field is defined like this:

{
name: 'linhas',
type: 'relationship',
relationTo: 'linhas',
hasMany: false
}

The database and API responses look correct, so the issue seems to be only in the Admin UI.

Has anyone experienced this before or knows a possible fix?

Thanks!

half heron
#

can you share your collection config where you have your relationship field defined?

dapper hamlet
half heron
#

Ok thank you—your code looks correct, I think this might be a bug in the WhereBuilder

#

I will bring this to the team and open a github issue if this in fact the case—stay tuned

dapper hamlet
#

Ok! thank you

half heron
#

no problem!

dapper hamlet
#

i tested downgrading the packages and the issue seems to be related to version 3.79.0

when using:
payload@3.79.0
@severe epoch/next@3.79.0
@severe epoch/db-postgres@3.79.0

the Admin UI shows duplicated values in the relationship filter dropdown.

after downgrading to:
payload@3.75.0
@severe epoch/next@3.75.0
@severe epoch/db-postgres@3.75.0

the issue disappears and the dropdown works correctly.

so it looks like the bug was introduced somewhere between 3.75.0 and 3.79.0.

hope this helps 👍

viral orbitBOT