directus
directus copied to clipboard
Incomplete Display of Related Items in M2M Relationship
Describe the Bug
I have encountered a bug in Directus involving two collections in my case these are: listings and attributes. In the listings collection, there is a many-to-many (M2M) relation to attributes.
Problem Details
- When editing an existing
listingwith a non-admin account, only a small subset of relatedattributesis displayed, even though the system correctly finds all related items. - Using the search function reveals all related items, including those not initially displayed.
- This issue only occurs when updating a
listing. When creating a newlisting, allattributesare displayed correctly. - The bug affects all non-admin accounts, even those with admin rights. The main admin account does not experience this issue.
- The problem seems to be related to the number of items in the junction collection.
If I create a new M2M (many-to-many) relation field, it works perfectly until I import data into the junction collection.
Collection Details
listings: 789 itemsattributes: 123 items- Junction collection: 2303 items
Thank you for looking into this issue. Please let me know if you need any further information.
To Reproduce
- Create collections
listingsandattributeswith the following fields:listings: input fieldtitleattributes: input fieldname
- Create a M2M relation in
listingstoattributes. - Import data into
listingsandattributes. - Import data into the junction collection.
- Log in with any account other than the main admin account.
- Update a
listingand check the relation field.
listings_attributes-junction-collection.csv
Directus Version
v10.12.0
Hosting Strategy
Self-Hosted (Docker Image)
Database
PostgreSQL 16.3 on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit , postgis_version 1 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1, from https://neon.tech/