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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Should setting a deceased_date of a contact automatically set is_deceased?
Pages: [1]

Author Topic: Should setting a deceased_date of a contact automatically set is_deceased?  (Read 310 times)

johanv

  • I post occasionally
  • **
  • Posts: 65
  • Karma: 5
  • #chiro #geek #linux #beer
    • my homepage
  • CiviCRM version: 4.7.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
Should setting a deceased_date of a contact automatically set is_deceased?
January 28, 2015, 01:24:57 am
Hi all, and happy Cividay to everybody :-)

I have another question. I noticed that when I set the deceased_date of a contact, using the API, the value of is_deceased (typically 0) stays unchanged.

I wonder whether it would be a good idea to automatically update is_deceased when a contact's deceased_date is set or cleared.

Any thoughts about this?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Should setting a deceased_date of a contact automatically set is_deceased?
January 28, 2015, 01:28:19 am
I would argue yes to 'is set' but no to 'is cleared' as I think you could decide you didn't really know when they died without them rising from the grave.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Should setting a deceased_date of a contact automatically set is_deceased?
January 28, 2015, 05:40:38 am
I think making the api "too smart" can cause problems in general (maybe not in this particular case). We have unit tests in place to make sure this sort of thing doesn't happen - the test will change a single field via api and then check to make sure no other fields got changed accidentally.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Should setting a deceased_date of a contact automatically set is_deceased?

This forum was archived on 2017-11-26.