Closed dsod closed 1 week ago
Hey @dsod, thank you for you issue! Fixed in https://github.com/payloadcms/payload/pull/8823
🚀 This is included in version v3.0.0-beta.118
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
https://github.com/dsod/payload-nested-docs-alias-bug
Environment Info
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 likeError: 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 theusers
collection is enough to trigger the error.Reproduction Steps
When the
parent
dropdown is opened from the UI and thefilterOptions
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