APIv4 Relationships refused if duplicated
Backlog
I see that @samuelsov already reported this, but the bot closed the issue #451 (closed).
Disabled Relationships
I came across a scenario where if a Contact Relationship was disabled, and you attempt to create a new one (that matches dates) it is refused. Ironically, the UI let's me add the Relationship.
- Create a Relationship with a start / end date
- Disable relationship
- Create a new Relationship with the same start / end date via UI (works)
- Create a new Relationship with the same start / end date via APIv4 (fails with Duplicate Exception)
Cases
Today, I came across another scenario where we are using ActivityProfile with CiviRules. The gist is that when someone submits a CiviCase then CiviRules assigned the Case Coordinator to their case. It's the same person each time.
In this scenario, the APIv4 is also refused the submission because of the duplicated Relationship. But really I think it makes sense to have multiple cases open for one person with the same case coordinator managing them all right?
My scenario can be replicated without ActivityProfile
- Create a Case for test user A and Coordinator X
- Create a new Case for Test User A
- Use the APiv4 to setup a relationship to Coordinator X
It should throw an exception Duplicate Relationship on relationship.create.
Thoughts?