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

[Bug]: CollectionTyps with relations #82

Open
foodiecompany opened this issue Dec 30, 2023 · 6 comments
Open

[Bug]: CollectionTyps with relations #82

foodiecompany opened this issue Dec 30, 2023 · 6 comments
Labels
bug Something isn't working workaround available

Comments

@foodiecompany
Copy link

What issue are you experiencing?

The current data lacks complete information about collection Types. It erroneously retains only the attribute count: 1 instead of preserving all attributes related to the collectionItem.

Steps To Reproduce

  1. Create CollectionType Events
  2. Create CollectionType Table
  3. Create relation between Events and Table (Table has many Events)
  4. Subscribed to Table:update and Events:update
  connect?.on("table:update", handleTable);
  connect?.on("event:create", handleEvent);
  connect?.on("event:update", handleEvent); 
  1. Change some data inside CollectionItem(Events)
  2. Missing all attributes inside Table
    image

What version of the plugin are you using?

2.0.4

What strapi version are you using?

4.16.2

@ComfortablyCoding
Copy link
Contributor

ComfortablyCoding commented Jan 8, 2024

Thanks for the report! It looks like this is due to webhooks.populateRelations being false in ./config/server.js. Whether this is intentional for this setting I do not know.

For now the workaround is to set webhooks.populateRelations to true. Keep in mind this can have a performance impact.

@foodiecompany
Copy link
Author

foodiecompany commented Jan 25, 2024

Thanks for the report! It looks like this is due to webhooks.populateRelations being false in ./config/server.js. Whether this is intentional for this setting I do not know.

For now the workaround is to set webhooks.populateRelations to true. Keep in mind this can have a performance impact.

The current solution is partially effective; however, there are additional issues. When creating a new collectionItem(Event), essential attributes for the related item are missing.

image

Thanks!

The update process for the collectionItem is functioning correctly.

@ComfortablyCoding
Copy link
Contributor

ComfortablyCoding commented Jan 28, 2024

I cannot reproduce this issue with the provided information. The table relation shows up in the emitted data when an event is updated. Please ensure permissions are correct for whatever role the data is being emitted to.

Screenshot from 2024-01-28 13-34-35

@ldiellyoungl
Copy link

ldiellyoungl commented Mar 21, 2024

when merging ???

@ComfortablyCoding
Copy link
Contributor

ComfortablyCoding commented Mar 21, 2024

when merging ???

It will be fixed whenever someone has time to research and add a proper fix. The proposed one is not an ideal solution to this issue as it is always populating all fields at first level which has performance ramifications.

This is a small open source project maintained in people's free time their should be no expectation of maintenance and/or fixes applied.

Unfortunately at the moment this project is not maintained by anyone specific, until it is this issue will most likely remain open.

Their is a workaround posted above in #82 (comment)

@ldiellyoungl
Copy link

Understood, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround available
Projects
None yet
Development

No branches or pull requests

3 participants