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

Import Activities matches Activity Type to NAME, should match to LABEL

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.7
    • Fix Version/s: 4.1.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      1. When user selects mapping to 'Activity Type Label' - the code is currently actually matching to civicrm_option_value.name instead of .label column. This is incorrect and confusing since users may change activity type label (which does NOT update .name column) - and the name column value is not displayed to users. Change the import code to match to Activity Type Label on civicrm_option_value.label string instead. Then, if no valid match - change error message from:
      "Invalid Activity Name"
      to:
      "Invalid Activity Type Label"

      2. Fix Notices on Preview and Summary steps
      Notice: Undefined offset: 2 in CRM_Activity_Import_Form_MapField->postProcess() (line 557 of /Users/dgg/svn/crm_v4.1/CRM/Activity/Import/Form/MapField.php).
      Notice: Undefined index: activity_id in _civicrm_api3_activity_create_spec() (line 196 of /Users/dgg/svn/crm_v4.1/api/v3/Activity.php).

      — Original post ----
      Tested and reproduced on the demo as of 12/06/11

      When attempting to import activity records, the import will fail with the corresponding errors:

      • import activities using the Activity Type ID field - error: Invalid Activity Type ID
      • import activities using the Activity Type Label field when the Activity Type Label includes a hyphen, and perhaps other special characters- error: Invalid Activity Name

      Note also this second error is confusing because there is no "Activity Name" field involved in the import. The error should be "Invalid Activity Type Label" which is the actual name of the field (or it should be "Invalid Activity Subject" if that is indeed what it means, though i don't think it is).

      OK: here is some additional information: When you import activities and use the "Activity Type Label" the import process is really trying to match that to the field "Activity Name" in the table civicrm_option_value. Problem is, that field is set ON CREATION of an activity type, with whatever the user puts in the "Activity Label" field. The "Activity Name" field is never actually shown to the user, and they can never change it. If the Activity Label never changes, then this is not a problem, but Activity Labels CAN change.

      So here are my proposed solutions: The Activity Name field which is basically the permanent machine name for an activity type should be displayed in the activity types option list in the admin section.
      The activity import mapping screen should not allow you to import by Activity Type Label, only Activity Name, and there should be help text explaining where to find the activity name ie: "The Activity Name is the machine name for the activity type. While the activity label can be changed in admin > option lists > activity types, the activity name cannot change. It is set as the same as the Activity Label when the activity is originally created. To find the activity name, admin > option lists > activity types and look for the activity name field." of course these instructions would only make sense IF the activity name field is exposed to the user there.

      ADDITIONALLY: i would suggest that on import the user should be able to select the duplicate matching rule to use, as you can do when importing contacts. The lack of this option, or the divergence in behavior between the import functions for different record types only serves to confuse the user.

        Attachments

          Activity

            People

            • Assignee:
              rohan Rohan S. Chavan
              Reporter:
              gregoryheller Gregory Heller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: