1

We have 'Allow Multiple Case Clients' enabled on our CiviCRM instance. Before we upgraded to the current version, we were able to add different contact types (individual and organization) to the same CiviCase. But now we cannot. I verified that this is also not possible on the Sandbox version 5.44.alpha1.

I thought the problem might be with the relationships so as an experiment I set all relationship contact types to 'all contacts' instead of 'individual' or 'organization.' But that didn't resolve the issue.

The Case Add Client miniform restricts the search for adding additional new clients based on the client contact type that already exists on the case. See the attached images.

Add new client - one is an example of adding a new client to a case to which an organization is already attached; the other is one where an individual is already attached. The selection only allows for the same contact type to be added.

Is this a purposeful change to disallow mixed client contact types (ind/org) on the same record or is there something else that I need to do to get this to work?

Your help is appreciated.

UPDATED (based on the fact that this is custom functionality):

I'd like to alter this behavior by setting the contact type API parameter to "IN":["Individual","Organization"] rather than using the variable $contactType.

I thought I might be able to use hook_civicrm_buildForm but the CRM_Case_Form_CaseView form includes elements that are hidden and thus do not show up in the $form variable as _elements.

This is the element in CaseView.tpl that I would like to alter the parameter value:

Are elements of class 'hiddenElement' accessible to hook_civicrm_buildForm? Or should I be using a different approach?

Thanks for your help.

3
  • Which civicase is this? The compucorp one or the built-in one?
    – Demerit
    Nov 2, 2021 at 20:26
  • Thanks for the response, @Demerit. This is the built-in one. Nov 2, 2021 at 20:47
  • I don't remember seeing any changes that should change this.
    – Demerit
    Nov 2, 2021 at 21:22

1 Answer 1

1

It looks like it's been this way since 2015. What version did you upgrade from?

https://github.com/civicrm/civicrm-core/pull/6806/commits/e7e572807e8ec866d63584f280a7a78d3d9c738a

5
  • It's a new client that we updated from 4.3.x. Thanks for the link. Nov 3, 2021 at 0:15
  • Ah that would explain it.
    – Demerit
    Nov 3, 2021 at 0:20
  • I have updated the question along with my attempt to find a custom solution to this issue using hooks. Nov 3, 2021 at 23:04
  • You could try docs.civicrm.org/dev/en/latest/hooks/…
    – Demerit
    Nov 3, 2021 at 23:11
  • 1
    I was able to restore the ability to add mixed client contacts by using the hook__civicrm_alterContent and replace the <input name="add_client_id... element in the content. Thanks again for your assistance Demerit. Nov 4, 2021 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.