Details
Description
This prevents updates to cases (eg. changing case status).
Caused by CRM-20537 (https://github.com/civicrm/civicrm-core/pull/10318/commits/738b63efa9ddd64488543726ea5282c5cb16b236) but effects only show once the database index is actually updated (by the CiviCRM check indices or manually).
The function CRM_Case_BAO_CaseContact::create requires that you either specify a CaseContact ID or it will try and add a new one. However, the database index UI_case_contact_id has recently been changed to be UNIQUE and was causing the function CRM_Case_BAO_CaseContact::create to crash. The change has been in CiviCRM since 4.7.20 but I suspect the change was only made recently to the database as CiviCRM started warning when indexes were inconsistent.