4

Goal is to let X "favourite" Y and vice versa

But seems that civi won't let us do both between the same two contacts, ie we cannot let X favourite Y and at same time have Y favourites X.

Is it meant to be impossible to have 2 people with same relationship twice, once in either direction?

  • I can't think why it wouldn't allow this - what happens if you manually insert the 2nd in the civicrm_relationship table? – Demerit Jul 4 '16 at 22:10
  • it works fine. Looks like there is some code in github.com/civicrm/civicrm-core/blob/… that is prohibiting this. so maybe an extension that provides a per relationship checkbox to permit (or prohibit depending which should be default) bi-directional relationships – petednz - fuzion Jul 5 '16 at 4:51
  • 1
    We have had this fixed but i haven't had a chance to get the extension published or shared. – petednz - fuzion Sep 3 '16 at 9:19
  • note to self: r10680 – petednz - fuzion Nov 2 '16 at 19:50
3

Doing some research on your find using svn blame and svn log on the old svn repo, this appears to have been implemented as part of https://issues.civicrm.org/jira/browse/CRM-58, and the key comment is

i.e. if there is "Parent" relationship between 2 contacts then you cannot add another relationship "child " between them.

The code for this is also what's stopping adding the second "favourite". So it seems like the checking is too aggressive - makes sense to prevent the parent being a child of their spouse (except in some geographical regions where it might be true (grin)), but not your use-case.

| improve this answer | |
1

This is now possible and there is a patch to optionally allow bi-directional relationships in JIRA

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.