Skip to content

Mutual relationships won't display in both entries #72

Closed

Description

@mo7orh3ad

Bug Report

Hi, i followed the given examples in the demo for relationship A and relationship B. I currently have 2 collections having one relationship field each. If i got this right it should be possible to set a mutual relation this way. Now, when i save one entry of collection A ("Profile") with a relation to an entry of collection B ("Meta") it would save and display the relation after reopening the entry int the editor. Doing the same with entry B would save the relation as well (at least according to the record in the db) but it won't get displayed in the relationship field and the API's json response.

Expected Behavior

The relationship fields should keep the values when re-opening an entry in the editor and return the relation in the API's repsonse.

Current Behavior

see above.

Steps to Reproduce

see above.

Detailed Description

Relationship field in collection A (Profile)

name: 'relatedMeta', 
type: 'relationship',
label: 'Select related meta entry',
relationTo: ['meta'],
hasMany: false,
access: {
    create: () => true,
    read: () => true,
    update: () => true,
},

Relationship field in collection B (Meta)

name: 'relatedEntry',
label: 'Related entry',
type: 'relationship',
relationTo: ['profiles'],
localized: true,
hasMany: false,
access: {
    create: () => true,
    read: () => true,
    update: () => true,
},

Activity

  1. jmikrut commented on Feb 17, 2021

    @jmikrut
    Member

    Hi @mo7orh3ad — I have confirmed this bug and it has to do with the fact that this field is localized. We have a few improvements to our localization implementation coming out for issue #71 shortly, and this fix will resolve both this issue and that issue.

    Thank you for logging this! Give us a bit here and we'll have a new version published for you!

  2. DanRibbens commented on Feb 21, 2021

    @DanRibbens
    Contributor

    Everything should be working in v0.2.13 that was just released. Feel free to reopen and let us know if your problem remains after updating.

  3. jimsheen commented on Feb 18, 2022

    @jimsheen

    @DanRibbens @jmikrut Hey guys, i'm running into the same issue in v0.14.0. Should I open a new issue?

  4. CiprianSpiridon commented on Sep 9, 2022

    @CiprianSpiridon

    @DanRibbens @jmikrut I'm running into the same issue in v1.0.34

  5. thgh commented on Feb 15, 2023

    @thgh
    Contributor

    Would love to see documentation on how to handle relational data that can be queried from both ends.

    I'm also looking for an example UI implementation of Organization<--Member-->User.

  6. roydigerhund commented on Apr 25, 2023

    @roydigerhund

    Is there any solution to query/filter a relation on both documents? I have a collection Articles which has relationship to the collection Categories and I would like to query all categories with a count for the related articles.

  7. github-actions commented on Sep 7, 2024

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  8. locked as resolved and limited conversation to collaborators on Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions