strapi / documentation

Strapi Documentation
https://docs.strapi.io
Other
1.03k stars 1.12k forks source link

Relations: Entry title not working for linked content-type #1694

Open Xzandro opened 1 year ago

Xzandro commented 1 year ago

Bug report

Required System information

Describe the bug

I try to create a relation beween a Membership and a Product. When I go to the "Configure the view" I set the "Entry title" to name. Now I go to a Membership and would like to add a Product to it. But instead of having the name of the Product visible, I only see the stripe ID, which is also a text field. I definitely did set the Entry title to name. Both content-types are created via a custom plugin and have a relation like:

Membership:

"product": {
  "type": "relation",
  "relation": "oneToOne",
  "target": "plugin::payments.product"
}

I have more relations and all have this issue, independent of what relation type they have. Even the user-permissions plugin has this issue. I extended it to have a fullName property and when I select that as an Entry name (or any other property), it still only shows the username.

I searched for it on the Discord and there were a few (mostly dead) open threads for it, but I'm a bit confused why it does not seem to have much recognition there, since in the current state, it makes the usage of relation impossible if you would like to let the user choose one manually, because no one will recognize an entity like this. My theory was at first, that this might happen only when content-types are created for a plugin, but then I tried it with a normal content-type and there it also does not work.

Or maybe I misunderstood something. Is there some easy workaround? Would it help if I remove the whole content-type and create it new, but with the name property first now as an attribute?

Steps to reproduce the behavior

  1. Create a relation between two content-types
  2. Change the Entry title
  3. Go to the content-type, which has the relation and the labels in the list will not display the chosen entry title

Expected behavior

Entry title will be taken for the relation labels.

Screenshots

image image

Boegie19 commented 1 year ago

@Xzandro This issue will be moved to documentation. Since this seems to me like it is a documentation issue.

To answer your question: Open the content Manger. Click the collection type of membership. Click on an existing entry or create new entry. Click Configure the view. Click on the pencil next to name. Now set the Entity title in this view and save.

Xzandro commented 1 year ago

Thank you, that was a bit hidden, but seems to work fine.

Boegie19 commented 1 year ago

@Xzandro That is the reason why I moved it to docs so that the docs can be improved and then it should become less hidden.