fix(plugin-ecommerce): remove invalid deletedAt query when trash is disabled by Gap0507 · Pull Request #16373 · payloadcms/payload · GitHub
Skip to content

fix(plugin-ecommerce): remove invalid deletedAt query when trash is disabled#16373

Open
Gap0507 wants to merge 1 commit intopayloadcms:mainfrom
Gap0507:fix/validate-options-deletedAt-query
Open

fix(plugin-ecommerce): remove invalid deletedAt query when trash is disabled#16373
Gap0507 wants to merge 1 commit intopayloadcms:mainfrom
Gap0507:fix/validate-options-deletedAt-query

Conversation

@Gap0507
Copy link
Copy Markdown

@Gap0507 Gap0507 commented Apr 23, 2026

What?

Removes the deletedAt filter from the variants join query in the validateOptions hook.

Why?

The current implementation assumes the presence of a deletedAt field. When trash is disabled on the Variants collection (trash: false), this field does not exist, causing a QueryError:

"The following path cannot be queried: deletedAt"

This breaks variant creation and updates.

How?

Removed the deletedAt clause from the join query. Payload already excludes soft-deleted documents by default unless explicitly requested, making this filter redundant.

Notes

Fixes #16367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plugin-ecommerce] validateOptions hook fails when trash is disabled on Variants collection

1 participant