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

Issue with dynamic zone. #14968

Closed
toxicity1985 opened this issue Nov 23, 2022 · 14 comments · Fixed by #15254
Closed

Issue with dynamic zone. #14968

toxicity1985 opened this issue Nov 23, 2022 · 14 comments · Fixed by #15254
Assignees
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: pending reproduction Waiting for free time to reproduce the issue, or more information

Comments

@toxicity1985
Copy link

toxicity1985 commented Nov 23, 2022

Bug report

Required System information

  • Node.js version: v16.14.0
  • NPM version: 8.3.1
  • Strapi version: 5.4.2
  • Database: MariaDB
  • Operating system: Debian

Describe the bug

Impossible to edit a single-type with dynamic zone and content inside

Steps to reproduce the behavior

-> Create a dynamic zone in a single-type.
-> Add content in it.
-> Save and then reopen the content and it does not appear. But i can see the content through the debug bar( the api call).

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

imageµ

@toxicity1985
Copy link
Author

Hello.

I'm trying to debug myself to find what's wrong. I just found that the componentPath are not ok. Do you know where that value is set ?

image

@joshuaellis
Copy link
Member

can you share your schemas and component schemas? This will help debug when someone is available.

@toxicity1985
Copy link
Author

Hi,

It's difficult to share some schema but I think i undestand the issue. We have some component who have relations with field name "content". The relation is not the same between the components. In the screenshot, you can see what happens.

image

@joshuaellis joshuaellis added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: pending reproduction Waiting for free time to reproduce the issue, or more information labels Dec 2, 2022
@toxicity1985
Copy link
Author

I update strapi to the last version and issue is there. I can send you in private the component, type and single type defined.

@joshuaellis
Copy link
Member

Hey @toxicity1985, we're still unable to reproduce your error, we've edited our functions to remove this undefined in the paths issue, but are currently unable to make the page "blank".

I didn't fully understand this comment:

We have some component who have relations with field name "content". The relation is not the same between the components. In the screenshot, you can see what happens.

Can you try to re-explain this? potentially which schema examples? Otherwise to address this issue we would need you to supply a reproducible example, this might be quicker tbf.

@mirkods
Copy link

mirkods commented Dec 13, 2022

Hi all, I'm experiencing the same issue so I add some information to help you all in debugging this problem.

I have the following schema called learning unit

Screenshot 2022-12-13 at 14 32 41

Then I have a component Unit that has a one to many relation with my learning unit schema

Screenshot 2022-12-13 at 14 33 02

At the end I have another schema called learning module that has Unit as a repeatable component

Screenshot 2022-12-13 at 14 36 24

The problem mentioned in this issue is present is in the learning module objects. Basically when I create a new entry I correctly populate the relations in the repeatable component and I save it but when I refresh the page the relations are not visible anymore in the entry page while I can see them in main table of the schema.

Here a quick video:

issue.mov

Please, let me know if the problem is clear or if you need more information.

Best,
Mirko

@ronronscelestes
Copy link
Contributor

hi @mirkods thank you for sharing this, I will try to replicate this issue
I have some questions:

  • with what Strapi version are you experiencing this issue?
  • did you create those CT/components with another Strapi versions?
  • could you add a screenshot of the network GET request of your entity to make sure the front receives well your rep component data? example in the screenshot :

image

in the meantime, #15139 is included in today's release, when the new version is out could you try updating your project to see if you're still experiencing this issue? 🙏

@mirkods
Copy link

mirkods commented Dec 14, 2022

Hi @ronronscelestes,

  • Strapi version 4.5.3
  • Yes, probably with some version 4.4.x. I also tried to rename this component in order to force model update on the new verision
  • Here the screenshot. As you can see the frontend receives the data correctly

Screenshot 2022-12-14 at 15 53 03

I confirm that with the version 4.5.4 I'm still having this problem.

Mirko

@ronronscelestes
Copy link
Contributor

hi again @mirkods
I spent some time trying to reproduce this issue locally with the provided information you gave but I'm not not running into any issues:

image
image

could any of you share a minimal viable reproduction of the issue, so we could reproduce it and find a solution?
this could help you to find the best approach 😊

@mirkods
Copy link

mirkods commented Dec 20, 2022

Hi @ronronscelestes,

Bug report

Schemas that use repeatable components that has a relation inside are saved correctly but the dashboard doesn't show the relations anymore after saving the entry.

System information

  • Node.js version: 16.14.0
  • NPM version: 8.3.1
  • Strapi version: 4.5.4
  • Database: pg/ postgresql dev database locally
  • Operating system: Mac

Steps to reproduce the behavior

  1. Download the zip file here (https://github.com/strapi/strapi/files/10272584/bug.zip)
  2. Create locally a postgres db called strapi_bug with a schema inside it called strapi
  3. Create a full access user for this database with username user and password password (we are reproducing locally the ./config/database.js setup)
  4. Unzip the file and run npm i inside the folder and the npm run develop
  5. With the content manager create one or more entry in the collection unit
  6. Now create an entry in the collection module and in the units field add a relation with one of the unit created before
  7. Save the module entry
  8. Now if you refresh the page the relation disappear while it will be visible in the main collation table

Screen Recording

Here a screen recording of the steps described above
https://user-images.githubusercontent.com/2368194/208766481-668bb02d-ffc7-46c5-83fd-ea370a13c5e5.mov

Hope that now you guys are able to reproduce the bug correctly.

Best,
Mirko

@marcosantonocito
Copy link

Hello @ronronscelestes,

I tried reproducing this issue on Strapi Demo (https://strapi.io/demo), and it's also not working there.

Steps to reproduce the behavior

  1. Create a new live demo on Strapi Demo and log into it
  2. Create a new collection called "ingredient" and add a short text field called "name". Save it.
  3. Create a new component called "relation" and add it to one category. Add two fields inside this component: a short text field called "name" and a one-to-many relation field to the collection "ingredient". Save it.
  4. Create a new collection called "recipe, add a short field called "name" and a repeatable component named "ingredients". The repeatable component has to be the one created in point 3. Save it.
  5. Enter the Content Manager section and create some ingredients. Save and publish each of them.
  6. Create a recipe in the Content Manager section and add some ingredients. Save.

After saving, you will not see any of the ingredients added on point 6, but if you return to the recipes list, you will see the number of added ingredients.

@ronronscelestes
Copy link
Contributor

thank you @marcosantonocito and @mirkods for the very helpful indications - we found the issue, you can read more about it in the PR that I have opened and linked to this issue!

@mirkods
Copy link

mirkods commented Dec 23, 2022

Thanks @ronronscelestes.

Are you able to provide us an estimate time for the release of this fix?

Mirko

@ronronscelestes
Copy link
Contributor

@mirkods I think it should be merged for the next release on 28th of December 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: pending reproduction Waiting for free time to reproduce the issue, or more information
Projects
Status: Fixed/Shipped
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants