fix(drizzle): skip column if undefined in findMany #12902
Merged
+15
−2
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?
This PR fixes an issue where sorting on a traditional virtual field with
virtual: true
while using a drizzle-based db adapter would cause a runtime error.Why?
To skip attempting to sort virtual fields which are not linked to a relationship/upload and prevent a runtime error from surfacing.
How?
Skipping the deletion of the property from the
selectFields
object if the column is false-y.Fixes #12886
Before:
20250621-1932-31.0302457.mp4
After:
virtualfields-sort-Posts---Payload.webm
Collection config used above