Skip to content

Multiple query filters on array fields produce "Alias "x" is already used in this query" error #8517

Closed

Description

@dsod

Link to reproduction

https://github.com/dsod/payload-nested-docs-alias-bug

Environment Info

Payload: `3.0.0-beta.109`
NodeJs: 20x
Postgres: 15x

Describe the Bug

When you add multiple query filters onto a array field, for example through access control functions and filterOptions using a Postgres server, Drizzle will throw an error like Error: Alias "" is already used in this query.

The reproduction repository I created is using the Nested docs core plugin to reproduce the error. The plugin adds filterOptions onto the parent field, this in combination with my access control function on the users collection is enough to trigger the error.

Reproduction Steps

When the parent dropdown is opened from the UI and the filterOptions is triggered, which filters on the breadcrumbs field in addition to my access control query, the error is triggered.

More details can be found in the repo readme.

Adapters and Plugins

db-postgres, nested-docs-plugin

Activity

  1. added
    status: needs-triage
    on Oct 2, 2024
  2. self-assigned this
    on Oct 7, 2024
  3. removed
    status: needs-triage
    on Oct 7, 2024
  4. added
    status: verified
    on Oct 7, 2024
  5. added
    plugin: nested-docs
    on Oct 14, 2024
  6. r1tsuu commented on Oct 22, 2024

    @r1tsuu
    Member

    Hey @dsod, thank you for you issue!
    Fixed in #8823

  7. removed
    status: verified
    on Oct 22, 2024
  8. github-actions commented on Oct 24, 2024

    @github-actions
    Contributor

    🚀 This is included in version v3.0.0-beta.118

  9. github-actions commented on Oct 25, 2024

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  10. locked as resolved and limited conversation to collaborators on Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

created-by: Contributorplugin: nested-docs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions