Details
Description
Discovered this while retesting CRM-6527. When case activities are initially created, a activity_target row is inserted for each activity with the client as target_contact_id. So for a brand new case, the Find Activities WITH "cliientName" works fine. Once you edit an activity in the case, a new revision of the activity is created as expected. But no new activity_target row is inserted for the new revision.
This causes several problems, including the fact that you can no longer find the activity using the client name. Also, the WITH value is empty when you view the new revision from civicrm/contact/view/activity?atype=32&action=view and missing from selectors (whenever activity is viewed outside of case container).
FIX: The code which creates the new activity revision should always insert an activity_target row for the client by default
.
NOTE: In 3.2, the user can choose to select a different Contact for the WITH value. Please verify that this functionality works properly after fixing the default behavior. It's possible that this bug was introduced when the new option was added for 3.2.
NOTE: I was concerned that the same problem might exist for Assignees and revisions - but the appears to work correctly (new activity_assignee rows are inserted during the create revision process.