Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Xzandro opened this issue May 9, 2023 · 3 comments
Open

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

Xzandro opened this issue May 9, 2023 · 3 comments
Assignees
Labels
issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io

Comments

@Xzandro
Copy link

Xzandro commented May 9, 2023

Bug report

Required System information

  • Node.js version: 16.20
  • NPM version: 8.1.0
  • Strapi version: 4.9.0
  • Database: PostreSQL
  • Is your project Javascript or Typescript: Javascript

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
Copy link
Contributor

@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.

@joshuaellis joshuaellis transferred this issue from strapi/strapi May 10, 2023
@Xzandro
Copy link
Author

Xzandro commented May 10, 2023

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

@Boegie19
Copy link
Contributor

@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.

@pwizla pwizla self-assigned this Oct 18, 2023
@pwizla pwizla added the issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io label Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: docs/instructions Issues about incorrect instructions found on docs.strapi.io
Projects
None yet
Development

No branches or pull requests

3 participants