Skip to content

add_related breaks existing ObjectProperties parent Objects #237

Open
@gtback

Description

@gtback

The current implementation of add_related (used to relate two different objects together) is currently broken. If you create three ObjectProperties (A, B and C), and run the following:

A.add_related(B, ...)
C.add_related(A, ...)

then the relationship between A and B will be broken. This is due to the fact that relationships are between Objects, but the add_related function operates on the contained ObjectProperties. add_related creates a new RelatedObject (see here) as the parent of the ObjectProperties that is being added. Thus, the relationship between A and B is severed as a result of the second call.

A workaround is to switch the order of these calls. This is not a 100% solution for more complicated sets of relationships, but should hopefully help until we can fix this.

C.add_related(A, ...)
A.add_related(B, ...)

Thanks to @brlogan for identifying this bug.

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