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 Import (Moderator: Yashodha Chaku) »
  • Import Update/Fill with custom data silently failing
Pages: [1]

Author Topic: Import Update/Fill with custom data silently failing  (Read 5543 times)

effex100

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
  • CiviCRM version: 4.3.5
  • CMS version: Joomla 2.5.9
  • MySQL version: 5.0.96-community
  • PHP version: 5.3
Import Update/Fill with custom data silently failing
June 15, 2012, 11:21:45 am
I'm using 4.1.3 on Joomla 2.5.4.

I have a lot of organization contacts that I've been importing from CSV. I'm using a lot of custom data fields.

There's a handful of records that were incomplete during the initial import. I'm trying to update them using another CSV file but it seems to be failing silently.

What happens is...

I import the records using a custom dedupe rule that only checks the record's external ID.
All the fields pass the first check.
I select to add a tag to the imported records.

Once done the system says:

Total Rows    143    Total number of rows in the imported data.
Total Contacts    143    Total number of contact records created or modified during the import.
Tagged Imported Contacts    import-2012-06-15: 0 contacts are tagged with this tag.

143 is all the records, the system says they were imported or updated but noting has changed.

I figured out through trial and error that if I only map core fields with no custom data fields the import completes successfully but as soon as I add ANY custom data field the import doesn't update anything.

Anyone have an idea what's going on here?

Thanks.

Thanks for the help.

flug

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 12
Re: Import Update/Fill with custom data silently failing
September 12, 2012, 11:03:31 pm
I'm having the same exact problem.  Civicrm 4.2 under Drupal 6.

My suspicion is some of the custom data that is being imported does not fit the data type CiviCRM is expecting--maybe boolean data that isn't boolean or something from a select list that doesn't match.  Why it wouldn't thrown an error, I don't know but no error appears either on screen or in the watchdog logs.

flug

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 12
Re: Import Update/Fill with custom data silently failing - solution
September 17, 2012, 01:12:03 pm
OK, here is the solution.

The problem is that boolean & date fields for custom data (ONLY) cannot be blank.  The 'check' step wasn't checking this, however.  So the data checked out fine but the import step was skipping those records altogether.

This patch fixes the problem by checking the custom data for boolean and date fields that are empty, and gives you and error at the 'check' step so that you can go back and correct.

This is not the 'real' solution to the problem, which probably involves some extensive refiguring of the import system, but a quick fix to solve the immediate problem:

This patch fixes the empty boolean/empty date field problem, in /CRM/Import/Parser/Contact.php around line 1164, make this addition:

Code: [Select]
        /* validate the data against the CF type */
       
        //bhugh, 2012/09, for date & boolean, empty values are not allowed
        if ($value=="") {
          if (($customFields[$customFieldID]['data_type']) == 'Date' OR ($customFields[$customFieldID]['data_type'] == 'Boolean')) {
             self::addToErrorMsg($customFields[$customFieldID]['label'] . ": Boolean & Date Custom Fields may not be empty", $errorMessage);
          }
        } else
        /* end bhugh addition */
        if ($value) {
          if ($customFields[$customFieldID]['data_type'] == 'Date') {
            if (CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key)) {
              $value = $params[$key];
            }
            else {

I'll file a bug report on this.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Import Update/Fill with custom data silently failing
July 02, 2013, 07:43:12 pm
was wondering if this was filed / fixed / committed?  Having a lot of trouble importing custom fields.

robbrandt

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal
  • MySQL version: 5.1.41-3ubuntu12.9
  • PHP version: 5.3.6
Re: Import Update/Fill with custom data silently failing
July 10, 2013, 01:52:27 pm
I am having this issue as well, using 4.3.5.  At least it looks the same, I get similar messaging at the end and no tags assigned.  And I am using custom date fields.  I am going to try and apply the patch.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import Update/Fill with custom data silently failing

This forum was archived on 2017-11-26.