Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • CiviCRM Core CiviCRM Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,466
    • Issues 1,466
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • CiviCRM CoreCiviCRM Core
  • Issues
  • #1277
Closed
Open
Created Sep 27, 2019 by tunbola@compucorp.co.uk@tunbola

Issue with Return Value For Target Contacts Parameter in Activity Get API

When calling the Activity.Get API and part of the fields to be returned is the target_contact_id, the values for this field can grow really huge especially for the Bulk Email activity type. The value could sometimes run into thousands and this could affect performance for an Application that needs to have this parameter returned.

$result = civicrm_api3('Activity', 'get', [
  'sequential' => 1,
  'return' => ["target_contact_id"],
]);

When checking the default Core Activity page (civicrm/contact/view/activity) , I looked into how Core handles the Target contacts field on this page, It turns out that the fetch for the Target contact is limited to one per activity (See Here) so that is why there is no performance issue on that page.

I think that both the API and the Backend implementation should be aligned or at least allow the API to specify the number of target contacts to be returned for an Activity otherwise this becomes a huge performance issue for Frontends that need this API to create a view similar to civicrm/contact/view/activity and making use of the API.

Edited Sep 27, 2019 by tunbola@compucorp.co.uk
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking