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 »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Should contributions be permitted for deleted contacts?
Pages: [1]

Author Topic: Should contributions be permitted for deleted contacts?  (Read 820 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Should contributions be permitted for deleted contacts?
November 07, 2013, 03:34:14 am
At the moment, against 4.2.7 and 4.4.1, I can import a contribution for deleted contact.

My expectation is that CiviCRM should forbid creating contributions against a deleted contact.

What do others think? Are there use cases for this?

If not I'd like to suggest changing the BAO to prevent this.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Should contributions be permitted for deleted contacts?
November 08, 2013, 03:40:41 am
I do not think we should prevent this at BAO level, I think it should be an option. As long as a contact is in the database, there should also be the possibility to store things against it in case it gets restored. Otherwise the soft delete option makes less sense?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Should contributions be permitted for deleted contacts?
November 09, 2013, 10:34:53 pm
Erik,

When I look at the contributions tab of a deleted contact, the buttons for adding new contributions are not shown, on the assumption that we don't add contributions to deleted contacts. I think it makes sense to not import contributions for deleted contacts.

In the UI, soft-deleted contacts are referred to as being in the "Trash". In my view, the best analogy for a soft-delete is deleting a file on my computer, which my OS puts into a rubbish bin. I don't expect to be able to edit files in my rubbish bin.

Ken

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: Should contributions be permitted for deleted contacts?
November 10, 2013, 07:05:08 am

ken:

import is a batch process, so i think the rules are a wee bit different compared to the UI. since the person making the callcan decide whether to un-delete the contact / fix the contribution or do something else

i suspect for contributions, just not importing them is not a good option in some cases. You'll need to make it flexible and give the user an option (error, create new contact, add to deleted contact etc). If you'd like to work on it and figure out what the options are and integrate it with the current code base that would be great. We should also do the same for membership, participant and activities

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

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Should contributions be permitted for deleted contacts?
November 11, 2013, 03:59:53 am
Lobo,

Re: "error, create new contact, add to deleted contact etc"

The particular problem I'm seeing is where the contact is identified by contact_id. Not sure if it makes sense to create a new contact in that case. Ditto for external identifier.

I notice the code that summarises/totals contributions has a clause to ignore contributions from deleted contacts. So it appears Civi is already treating these as deleted contributions (as they would be if the contact was hard-deleted rather than soft-deleted). I hear what you and Erik are saying re flexibility, but the only valid use case I can see is to treat the import as an error if the contact is deleted.

Now if the contact is identified by name/email/etc, a new contact could be created in that scenario.

I'm just getting up to speed with git so I'll leave memberships etc for another time ;-)

Ken

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Should contributions be permitted for deleted contacts?
November 13, 2014, 04:11:49 am
See https://issues.civicrm.org/jira/browse/CRM-15593 for a suggested improvement.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Should contributions be permitted for deleted contacts?
November 13, 2014, 10:51:15 am
Ken Would be good to see questions like this asked at drupal.stackexchange.com and help us all get these regular questions managed in a better way. If you don't already have one, would you set yourself up an account, ask the question over there, paste link back here, oh and of course 'commit' to area51.stackexchange.com/proposals/77367/civicrm

(forum regulars - pls consider replicating this message on lots of threads to help lift our StackExchange proposal in to Beta - just copy the above and paste on other threads until someone starts complaining)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Should contributions be permitted for deleted contacts?
November 13, 2014, 11:43:10 pm
Peter,

I've already committed but we can't add questions until the commitment reaches 100%.

Ken

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Should contributions be permitted for deleted contacts?
November 14, 2014, 11:10:59 am
If it is a Drupal question, then ask it on drupal.stackexch..... - then others can answer and build up their reputation
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Should contributions be permitted for deleted contacts?

This forum was archived on 2017-11-26.