Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 984
    • Issues 984
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • Core
  • Issues
  • #774

Closed
Open
Opened Mar 04, 2019 by DaveD@DaveDDeveloper

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:

  1. Look in a case type definition to see which role is checked as "assign to creator".
  2. Under admin - customize data - relationship types, change the label(s) for the relationship type to something else.
  3. Create a new case with the given case type.
  4. 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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
5.20.0
Milestone
5.20.0
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#774