-
Notifications
You must be signed in to change notification settings - Fork 46
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 support in components/dynamic zones #132
Comments
@omikulcik could you please reopen this issue ? I think it's not done. It somehow works for direct relations on the model, but it doesn't work for relations in components / dynamic zone. At this moment, when you have some relations in components / dynamic zone, after create a new version, those relations are not persisted / transferred to the new version and they are just empty. Thanks |
@Sklico Sure, will reopen and try thinking of a solution to also support relations in the components. It is quite complex. |
any update on this? |
when i publish another locale the relations always getting removed. |
@ziermach I have been working on a fix for Dynamic Zones, hoping to open the PR soon. @omikulcik is right, it is complicated 😅 |
I started working on support of relations inside components last week. @ShipleyC95 how far are you? I guess we should sync so both of us do not work on the same thing. By the ways, it is amazing that you want to contribute! :) |
@omikulcik Then inside the Then I'm currently working on a function to call recursively that will put all the connections back together instead of the updatableRelations.forEach((rel) => {
const prevRel = previousVersion[rel];
...
connects[rel] = { connect: mergedConnects };
}); I'm hoping this is the right approach! I also spotted that in server/register.js that the relation update middleware is only being called on publish, so I've added PUT "/content-manager/collection-types/:model/:id" to that file as well. |
Happy to contribute, that's part of the joys of open-source 😁 |
🌟 Appreciation and Update Request 🌟 Hey @ShipleyC95 and @omikulcik, Firstly, a huge shoutout to both of you for tackling the dynamiczone relations issue! Your dedication and collaborative spirit are truly commendable. 🙌 I'm currently in the midst of an upgrade and your work on supporting relations inside components is crucial for my progress. Thank you for taking on this challenge! @ShipleyC95, could you please provide an update on your progress? Looking forward to hearing from both of you soon! 🚀 Cheers. |
@ShipleyC95 Your solution also makes sense to me. I am only not sure about calling the middleware also on PUT because then a relation that is not yet published could be assigned If I am right. It seems that you have gotten further than I did. Could you please submit a draft pr orupload your branch and we could split who does which part? You can do it all yourself if that is more comfortable for you. I just think that we should either cooperate or work on different features. @hafizasadabbas Thank you for your support! :) I hope that the information in the previous paragraph helps you. |
@hafizasadabbas @omikulcik @omikulcik; concerning the PUT request I noticed that if you create a brand new page, save it and don't publish it, then make a change and save it again, all the relations are removed. I hadn't considered the case of draft relations, so that's something you could potentially look into? |
@ShipleyC95 Sure, that sounds good. |
@omikulcik Would that make more sense under a separate issue or just under this one? (Happy to create one if needed) |
@ShipleyC95 In think in this one it is ok :) |
Hey, @omikulcik I've got Dynamic Zones working. Had a slight complication with the root relationships in doing so but have fixed it. I can submit a draft PR, however I don't have permissions to publish my branch, could you grant them please? There will still be some tidying up to do but wanted to give you visibility on my implementations so far. (Apologies for no update yesterday, hit a couple of snags along the way) |
@ShipleyC95 Can I see your work as I mentioned it's crucial for my progress and I think it will take time to merge. I am also working on a patch to fix it. |
@ShipleyC95 I have given you write access to this repo. However, I believe, you could make a fork of this repo and then request a PR but nevermind. I am looking forward to seeing your implementation! :) |
Thanks @omikulcik for granting permissions. I wasn't aware that forking -> PR was required, my apologies! @hafizasadabbas the draft PR is open now |
No worries. I will check the PR today. |
@ShipleyC95 appreciate your work but after applying your code it stops carrying forward the second dynamiczone component when I make the version. Can you please reproduce it on your side? |
@hafizasadabbas we are just solving that. You can get more updates in #158 |
Hi guys, |
Currently the plugin does not support versioning of relations. When a new version of content is created it's relations should be persisted. If the relation is also versioned and new version was created it's id should be updated.
The text was updated successfully, but these errors were encountered: