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 Registrations Date - CiviCRM 4.3.3
Pages: [1]

Author Topic: Import Registrations Date - CiviCRM 4.3.3  (Read 7658 times)

aspagarino

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 10
  • San Diego Joomla
    • California Center for Sustainable Energy
  • CiviCRM version: CiviCRM 4.3
  • CMS version: Drupal 7
Import Registrations Date - CiviCRM 4.3.3
June 07, 2013, 12:04:07 pm
I was trying to import some event participants and have problems with the Register Date field.

I tried usind the standard format first from the export mm/dd/yyyy and it displays the error message on the download participant_register_date not a valid date: 5/19/2013

The only format that is accepting is yyyy-mm-dd and I cannot add any time.

Went to the demo site and recreated the problem.
For testing on the demo:
  • Got 2 random participants in the current site for an event
  • Export the minimum required fields: Participant ID, Event ID, Participant Status, and Register Date
  • Changed the defaulted exported date 12/20/2009 to a different value (same format)
  • Imported the file using Update and expected date format mm/dd/yyyy
  • Download errors shows participant_register_date not a valid date: 5/28/2013
  • Changed csv date format to yyyy-mm-dd and it loads OK
  • But if you change date format to yyyy-mm-dd h:mm gets a DB Error: unknown error
Andres

Open Source is Green

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Import Registrations Date - CiviCRM 4.3.3
June 10, 2013, 02:23:11 pm
Hi Andres, it's Jon!

You should be able to turn on debugging and backtrace (<sitename>/civicrm/admin/setting/debug?reset=1 if you're using Drupal - it's in the Administer menu -> System Settings -> Debugging and Error Handling if not).  When you get "DB Error: unknown error", there's an underlying MySQL error - turning on debugging/backtrace should let you see what that error is.  Posting that should give a clue as to the fix!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

rares

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: WP 3.5
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Import Registrations Date - CiviCRM 4.3.3
November 25, 2013, 07:04:06 am
We were also getting this import errors in 4.4.1 with dates of format 12/31/2012. We did not try importing times, however we did notice that the selection of date format had no effect on the parsing of the date. We were only able to use the yyyy-mm-dd format. The code below shows that the date type SHOULD be taken into account, but it is not -- it just defaults to the regular.
We also received a DB error, and after enabling backtrace we discovered it was because the registered_by_id was getting set to a contact ID that did not exist. Do you guys think it makes sense to add a check in the code for that?

from CRM/Event/Import/Parser/Participant.php

    $dateType = $session->get('dateTypes');
...
        if ($dateValue = CRM_Utils_Date::formatDate($params[$key], $dateType)) {
          $params[$key] = $dateValue;
        }
        else {
          CRM_Contact_Import_Parser_Contact::addToErrorMsg('Register Date', $errorMessage);
        }

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import Registrations Date - CiviCRM 4.3.3

This forum was archived on 2017-11-26.