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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can an "Individual" contact not have a row in civicrm_individual table ?
Pages: [1]

Author Topic: Can an "Individual" contact not have a row in civicrm_individual table ?  (Read 1026 times)

yasheshb

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Can an "Individual" contact not have a row in civicrm_individual table ?
December 17, 2007, 02:18:39 am
Hello.

    While going thru a prepopulated civicrm db (which i'm quite sure contains corrupt data in many tables due to the means in which it was created)
i came across rows in civicrm_contact for contacts of type "Individual" which did not have a corresponding row in civicrm_individual.

  So the question is, is it possible that when a contact of type individual is created
using CiviCRM's standard interfaces (API, GUI etc) a corresponding row in civicrm_individual may not be needed ?

I tested it using the GUI interface in CiviCRM 1.9 i.e. just added an Individual with only an email address. This workflow
added an entry in the civicrm_contact and civicrm_individual table.

 I also browsed the code in CRM/Contact/BAO/Contact.php where i found 3 relevant functions.

static function &create(&$params, &$ids, $maxLocationBlocks, $fixAddress = true, $invokeHooks = true )
static function &createFlat( &$params, &$ids )
static function createProfileContact( &$params, &$fields, $contactID = null,

in both create and createFlat the functions for creating an Individual record are called but i could not located it in the createProfileContact function.
hence i'm unclear on whether a row in civicrm_individual has to exist for every row in civicrm_contact of type "Individual"

Thanks.

Yashesh Bhatia


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: Can an "Individual" contact not have a row in civicrm_individual table ?
December 17, 2007, 06:25:57 am

createProfileContact calls create which does the needed thing

There have been bugs in the past where an individual was not created for a contact. I would actually flip the problem around and first clean the database before attempting to find and isolate a bug in the code. If memory serves right, the "problem" data was imported using an old version of the petition module and/or a custom import script

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can an "Individual" contact not have a row in civicrm_individual table ?

This forum was archived on 2017-11-26.