Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13150

Related Org Name Column (and all contact columns) refer to Source rather than Target Contact on Activities Search Export

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.4
    • Fix Version/s: 4.4.0
    • Component/s: Core CiviCRM
    • Labels:

      Description

      For Activity Export, when contact fields are selected in Select Fields for Export (including Contact, Individual, Organization, Household) we are currently grabbing the contact data from the 'source' contact linked to the activity. This is generally not the expected nor the most useful behavior (given that we have to pick one activity relationship).

      At some point it may make sense to export columns for each contact related to the activity (source, target, assignee). However for now we should just swap and export data for the TARGET. For activities w/ multiple targets we can pick the first (lowest contact_id).

      This includes related contact info fields. So for example, if Actviity Source Contact = 202 and Target Contact = 25, AND the export includes 'Employee of' => 'Organization Name' - we should check for that relationships against Contact 25.

      ---- Original Post —
      In this real world example...
      Contacts are students of a High School.
      The search is performed for Activities, specifiying a "transfer" as the activity (don't think the type of activity is relevant), export is selected as the action... and the related High School (Organization) name is selected for the export fields.
      The field with the appropriate label is generated for the download, but it is not populated.

      Information from Troubleshooting so far:
      Doing an Advanced Search does not yield the bug.
      I have observed that the arguments to
      CRM_Export_BAO_Export::exportComponents()
      are different in each case.

      The Advanced Search generates a temp table, passed as the table name to the componentTable parameter.
      The Activities Search simply passes fields arguments.

      My client has some budget to pay me to supply this fix. I'm mainly looking for reassurance I'm on the right track and in particular if there is a good reason why the Activities search can't work the same as the Advanced search? Should the fix be to unify the two cases of calling exportComponents() so they both supply temp tables?

      To Reproduce:

      • Perform a default Activities Search
      • Select All Contacts for Export
      • Specify Fields and select organization -> organization name

      Observe that organization name is present (labeled) but empty in download.

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              ginkgomzd Michael Z Daryabeygi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: