When a relationship is disabled by end-date and cron job then in webform it shows blank (no or null) relationship, which it correct. When you then after a period you attempt to re-establish relationship with the same contact, the webform will retrieve the deactivated relationship and allow you to edit and re-enable it.
Although some might consider this a feature, to me this is a bug. When by end date a relationship was ended it should not be retrieved nor edited. To record history of this end date, a new relationship should be created, with a new start date. This bug causes a past relationship to be reused (edited and re-enabled) making it impossible to record the actual interruption of relationships.
If you know a way to still do this, then please could you change the issue Category to "Support request" and help me?
Comments
Comment #1
ñull CreditAttribution: ñull as a volunteer commentedComment #2
colemanw CreditAttribution: colemanw commentedI think we'd have a hard time getting consensus on whether this is a bug or a feature. But since CiviCRM core does allow this sort of thing, probably it would be good for this module to support the same.
Can you go ahead and submit a patch/PR for this?
Comment #3
ñull CreditAttribution: ñull as a volunteer commentedAt the moment, for lack of experience with CiviCRM coding, I try to circumvent it by using rules:
This theoretically would effectively save a copy of the unchanged relationship to keep a history record.
Comment #4
ñull CreditAttribution: ñull as a volunteer commentedI tried to work around it with rules, but #2512390: civicrm_relationship_update not triggering is hindering me there. When I have time, I try to have a look with a debugger, to see where in the code this is decided. When simple enough, I might even produce a patch.
Comment #5
gemma.potaka CreditAttribution: gemma.potaka commentedWe have just hit this issue also and would like to find a fix.
We will look at finding a fix that is optional either for the whole site, per webform or per relationship on the webform so that people have the choice as to whether they update an expired relationship or create a new relationship.
Do you have any pointers as to where to start tackling this?
Comment #6
colemanw CreditAttribution: colemanw commentedIt could be a per-form setting under "additional options"
Based on that setting the function wf_crm_webform_base::getRelationship() can return all or only active relationships.
Comment #7
colemanw CreditAttribution: colemanw commentedMerged https://github.com/colemanw/webform_civicrm/pull/74
Comment #8
petednz CreditAttribution: petednz commentedThanks for merging, and thanks to Jitendra for getting the patch sorted for us.
Comment #9
petednz CreditAttribution: petednz commentedperhaps you can tag me, or fuzion, with the commit?
Comment #10
colemanw CreditAttribution: colemanw commentedSorry what do you mean by tag you with the commit?
Comment #11
petednz CreditAttribution: petednz commentedDoesn't matter much. I thought on drupal there was a 'credit and committing' option so that folks who provide the commit get some sort of community recognition. I see it at the bottom of this form which suggests i can credit it to myself, which seems odd, and not sure if it is the correct thing to do since it seems to alter the 'git commit' msg that shows right at bottom of this page, and i don't want to mess with that unknowingly.
And anyway that credit should go to Jitendra's profile, and he should be linked to fuzion, and that is how the 'company' profile builds reputation.
minor issue. will discuss with jitendra if this needs further discussion
Comment #12
colemanw CreditAttribution: colemanw commentedSorry, this unfortunately has to be done by the committer before merging. Too late now.