Description
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 Object
s, 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.