You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a polymorphic relationship field within a 'Posts' collection, selecting an item with a specific ID from one related collection (e.g., Podcasts) causes other items with the same ID from other related collections (e.g., Videos, Images) to disappear from the relationship field options. This behavior occurs even though the items belong to different collections and should not interfere with each other.
To Reproduce
Steps to Reproduce the Behavior:
Define collections with a polymorphic relationship field in a Posts collection relating to Videos, Podcasts, and Images.
{
name: 'linkedContent',
type: 'relationship',
relationTo: ['videos', 'podcasts', 'images'], // This assumes these collections exist
hasMany: true,
},
Ensure there are items with overlapping IDs across these collections.
In the Payload admin UI, create a new post and attempt to link content using the linkedContent field.
Select an item from one collection (e.g., Podcast with ID = 1).
Observe that items with the same ID from other collections (e.g., Video ID = 1, Image ID = 1) disappear from the selectable options in the linkedContent field.
Expected Behavior: Items from different collections should not affect the availability of items from other collections in a polymorphic relationship field, regardless of shared IDs.
jamesryancooper
changed the title
Polymorphic Relationship Field ID Conflicts Across Collections Using PostgreSQL Adapter
[v3.0.0-beta.32] Polymorphic Relationship Field ID Conflicts Across Collections Using PostgreSQL Adapter
May 15, 2024
jamesryancooper
changed the title
[v3.0.0-beta.32] Polymorphic Relationship Field ID Conflicts Across Collections Using PostgreSQL Adapter
[v3.0.0-beta.32] Has Many - Polymorphic Relationship Field ID Conflicts Across Collections Using PostgreSQL Adapter
May 15, 2024
Link to reproduction
No response
Describe the Bug
In a polymorphic relationship field within a 'Posts' collection, selecting an item with a specific ID from one related collection (e.g., Podcasts) causes other items with the same ID from other related collections (e.g., Videos, Images) to disappear from the relationship field options. This behavior occurs even though the items belong to different collections and should not interfere with each other.
To Reproduce
Steps to Reproduce the Behavior:
Define collections with a polymorphic relationship field in a
Posts
collection relating toVideos
,Podcasts
, andImages
.Ensure there are items with overlapping IDs across these collections.
In the Payload admin UI, create a new post and attempt to link content using the
linkedContent
field.Select an item from one collection (e.g., Podcast with ID = 1).
Observe that items with the same ID from other collections (e.g., Video ID = 1, Image ID = 1) disappear from the selectable options in the
linkedContent
field.Expected Behavior: Items from different collections should not affect the availability of items from other collections in a polymorphic relationship field, regardless of shared IDs.
Payload Version
payload-3-0-0-beta-32
Adapters and Plugins
Adapter: @payloadcms/db-postgres, Database: Supabase (PostgreSQL)
The text was updated successfully, but these errors were encountered: