Changing the LABEL for a relationship type causes an error when creating a new case that has that relationship/role set as Creator
To reproduce, and I can reproduce this on dmaster.demo.civicrm.org:
- Look in a case type definition to see which role is checked as "assign to creator".
- Under admin - customize data - relationship types, change the label(s) for the relationship type to something else.
- Create a new case with the given case type.
- Fatal error.
It seems to ultimately come from here, where it looks up LABEL instead of NAME: https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/XMLProcessor.php#L114
The allRelationshipTypes() function seems to only be used in two places, and both seem to be trying to match on label when it should be name, so the fix is probably just change 'label' to 'name'.
But then I'm wondering if any existing configs that depend on label will suddenly break, and taking a step back, this label vs name mismatch has come up a few times over the years in a few places so I'm wondering if fighting it is just postponing the problem. But maybe that should be a separate issue: i.e. if "name" was an integer or goofy string, or the field were named something like "key", a recurrence of the problem would be more obvious.