Automatically closed - issue fixed for 2 weeks with no activity.
1.0 Problem/Motivation
Adding a default value of type 'relationship to' for contacts that have a subtype does not populate the list of relationships properly both ways.
When retrieving the relationship entries it will only match when the subtype order is the a to b way around.
Otherwise due to the reciprocal variable it doesn't check the subtype relationship b to a and the relationship is not available for the user to select.
2.0 Detailed steps to reproduce (embed screenshots)
Create a new relationship type (e.g Test Relationship)
Set contact a type 'Team' & contact b type 'Sponsor'
Create a civicrm webform with 3 contacts of type organisation & add the autocomplete field.
Set contact 1 & 3 to subtype 'Team'
Set contact 2 to subtype 'Sponsor'
Edit the Contact 3 autocomplete field, Set the 'Default value' as 'Relationship To Contact 2'
'Specify Relationship' properly populates 'Test Relationship' as an entry.
Edit the Contact 2 autocomplete field, Set the 'Default value' as 'Relationship to Contact 1'
'Specify Relationship' incorrectly does not list any relationships.
3.0 Proposed resolution
Tweak the conditional that builds the list to check for a relationship both ways by removing $reciprocal.
To avoid it printing twice add the reciprocal check when adding the label as it does for the first time.
This allows for situations where the subtype check fails a to b but is then added in b to a.
Edit the Contact 3 autocomplete field, Set the 'Default value' as 'Relationship To Contact 2'
'Specify Relationship' properly populates 'Test Relationship' as an entry.
Edit the Contact 2 autocomplete field, Set the 'Default value' as 'Relationship To Contact 1'
'Specify Relationship' properly populates 'Test Relationship' as an entry.
Fixed
6.2
Webform/Drupal
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.