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

2.0 update routine destroys activity history records

    Details

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

      Description

      The update routine only moves the following records into the new civicrm_activities table

      WHERE ah.module IN ('CiviContribute')
      WHERE ah.module IN ('CiviMember') AND ah.activity_type='Membership - New'
      WHERE ah.module IN ('CiviEvent')
      WHERE ah.module IN ('CiviMail')

      This means that any other data in the table is destroyed when civicrm_activity_history is dropped at the end of the update routine. This includes anything created via the activity_history API, any manually entered activities (ah.module = 'CiviCRM') .

      Here's data from one db:

      SELECT module , activity_type , count( * ) FROM `civicrm_activity_history` GROUP BY module , activity_type;

      CiviContribute Donation 84
      CiviContribute Member Dues 2008
      CiviCRM conference additional transaction 28
      CiviCRM conference registration 1118
      CiviCRM Donation 433
      CiviCRM Email Sent 502
      CiviCRM Event 1294
      CiviCRM Membership 706
      CiviCRM Past Registrations 7802
      CiviCRM Payment Pending 1
      CiviCRM Phone Call 1
      CiviCRM Product Purchase 36
      CiviCRM Send Benefits 105
      CiviCRM Sent Benefits 182
      CiviCRM Supporting Membership 173
      CiviCRM Transaction Completed 19077
      CiviCRM Work Exchange 265
      CiviMember Membership - Current 4701
      CiviMember Membership - Expired 5367
      CiviMember Membership - Pending 29
      CiviMember Membership - Supporting 22
      E-commerce Transaction 1693
      Ec-bioneers Transaction Canceled 33
      membership membership 1014
      registration conference additional transaction 110
      registration conference registration 3525

      And here's another:

      NULL Received <em>Check this out from ***.com!</em> 1054
      NULL Received <em>Check this out from ***.com</em> 4865
      NULL Received <em>Check this petition out!</em> 170
      CiviContribute Donation 1
      peoplesemailnetwork P000 113
      peoplesemailnetwork P001 365
      peoplesemailnetwork P017 5036
      peoplesemailnetwork P025 618
      peoplesemailnetwork P031 14054
      peoplesemailnetwork P055 2670
      peoplesemailnetwork P057 578
      peoplesemailnetwork P065 58826
      peoplesemailnetwork P066 9353
      peoplesemailnetwork P071 942
      peoplesemailnetwork P072 11917
      peoplesemailnetwork P073 34515
      peoplesemailnetwork P074 2298
      peoplesemailnetwork P075 203
      peoplesemailnetwork P076 22284
      peoplesemailnetwork P078 3014
      peoplesemailnetwork P080 15530
      peoplesemailnetwork P081 1104
      peoplesemailnetwork P082 8649
      peoplesemailnetwork P083 108
      peoplesemailnetwork P085 1518
      peoplesemailnetwork P086 8544
      peoplesemailnetwork P087 6000
      peoplesemailnetwork P088 113327
      peoplesemailnetwork P090 27795
      peoplesemailnetwork P091 18695

      Hmm, looks like there's some bad data in there too. There's obviosly a lot that that gets trashed. I haven't yet got a fix for this, I hope to work on that tomorrow.

      -dave

        Attachments

        1. activity.diff
          4 kB
          dave hansen-lange
        2. drop.diff
          4 kB
          dave hansen-lange
        3. Step6.diff
          3 kB
          dave hansen-lange

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              dalin dave hansen-lange
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: