CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Deleting activities with a contribution
Pages: [1]

Author Topic: Deleting activities with a contribution  (Read 655 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Deleting activities with a contribution
August 25, 2010, 04:43:40 am
I'm on Civi 3.1.5. I'm using it with Drupal / Ubercart / Ubercart CiviCRM integration. I want to make sure everything is working smoothly to ensure schema integrity down the road. One thing I'm concerned about is if I delete an ubercart order. I plan to write integration code to ensure that if an order gets deleted, the mirroring Civi transactions also get deleted.

When ubercart makes an order a contribution and an activity are both created in CiviCRM automatically. So when I delete an order, I will also want to delete both the activity and the contribution. First I went ahead to do this manually. I tested deleting the contribution relating to an order, but the activity stays. My questions are:

1) Shouldn't a relevant activity get deleted if its associated contribution gets deleted?

2) By deleting this contribution but not the activity, if I go to view the activity I get the Civi death error of the yellow screen and just a 'One of parameters (value: ) is not of the type Integer' message. Is this the type of thing that will eventually result in some kind of FK error when I try to upgrade someday?

3) Assuming the above is bad, I want to delete the activity, but there's no delete option (it appears) on my activity screen. So I need to delete manually in the db? Is there more than 1 table I'll need to delete from?

Thanks much,
Emily

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Deleting activities with a contribution
August 25, 2010, 07:16:14 am

1. how did u delete the contribution? there is code in the deleteContribution to delete the associated activity. if u deleted via the UI, can u try and reproduce this issue on the demo

2. that error is expected. i dont think so, since that FK is not a databased controlled FK, CiviCRM manages that FK

3. civicrm_activity_target and civicirm_activity_assignee are the two other tables related to civicrm_activity

lbo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Deleting activities with a contribution
August 26, 2010, 05:03:32 am
1. I deleted via the UI. Tested on demo but could not reproduce...but demo is currently 3.2 and I'm on 3.1. I also tested with an event registration contribution and it did not delete the associated activity. However, I thought I was on 3.1.5 and I'm actually on 3.1.3. I will upgrade tonight and then check this again to see if it is resolved. I will report back.

2. Thank you.

3. Thank you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Deleting activities with a contribution

This forum was archived on 2017-11-26.