directus-extension-tags-m2m-interface icon indicating copy to clipboard operation
directus-extension-tags-m2m-interface copied to clipboard

No Corresponding Fields Found

Open M-GRV opened this issue 1 year ago • 4 comments

I've tried doing this a few ways but everytime I select the collection I see this:

image

What should I be doing to make the collection compatible?

M-GRV avatar May 12 '23 20:05 M-GRV

@dimitrov-adrian any idea on what Im doing wrong?

M-GRV avatar May 19 '23 14:05 M-GRV

Same here

gokhanozdemir avatar Jun 11 '23 11:06 gokhanozdemir

I think I've fixed the issue, there's a value missing from this object which may have become required at some point.

https://github.com/dimitrov-adrian/directus-extension-tags-m2m-interface/blob/5207039cfb865f4b6903d0e42546882fa89cd955/src/index.ts#L58-L62

Add collectionName: relations.m2o?.related_collection to the options block so that it looks like this

 options: {
        collectionName: relations.m2o?.related_collection,
 	allowNone: false, 
 	typeAllowList: ['string', 'integer', 'bigInteger'], 
 	allowForeignKeys: false, 
 	allowPrimaryKey: true, 

then rebuild the project and drop in the updated index.js file. You'll now be able to see a "Corresponding Field" input in the Data Model editor where you've added the Tags component, which wasn't able to display before.

image

That new dropdown is the columns available on whatever "tags" table that's been set up for the many to many relationship. You'll need to set it to a column you want the tag values to be entered into. I had to manually create a value column on my tags data model so that I could select it in the dropdown.

gherkster avatar Jun 18 '23 10:06 gherkster

Is there a chance to get this extension updated with this fix anytime soon? @dimitrov-adrian

nico-kow avatar Jul 19 '23 09:07 nico-kow