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 Contacts fails because of long custom field name
Pages: [1]

Author Topic: Import Contacts fails because of long custom field name  (Read 640 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Import Contacts fails because of long custom field name
May 24, 2011, 04:15:18 pm
When I try to run the "Import Contacts" wizard  ( url: www.mywebsite.org/civicrm/import/contact )

I get the very long error message below. What is strange is the custom field column name "i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127"  does not exist anymore as a custom data field.

 

Database Error Code: Identifier name 'i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127' is too long, 1059
Additional Details:
Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => CREATE TABLE civicrm_import_job_7282127c8f2423e7aad72954fed7ee95 (`dup_basic_0` text, `username_1` text, `password_2` text, `contact_name_3` text, `group_4` text, `member_unit_5` text, `membership_type_6` text, `title_7` text, `first_name_8` text, `middle_name_9` text, `last_name_10` text, `photo_11` text, `email_12` text, `alternate_email_13` text, `primary_phone_number_14` text, `date_of_birth_15` text, `individual_notes_16` text, `about_me_17` text, `sex__18` text, `marital_status_19` text, `partners_first_name_20` text, `partners_last_name_21` text, `partners_email_22` text, `partners_primary_phone_number_23` text, `partners_date_of_birth_24` text, `ikar_experience_25` text, `neighborhood_26` text, `expiration_date_27` text, `street_address_28` text, `city_29` text, `state_30` text, `zipcode_31` text, `country_32` text, `home_phone_33` text, `work_phone_34` text, `work_phone_ext_35` text, `mobile_phone_36` text, `partners_work_phone_37` text, `partners_mobile_phone_38` text, `alternate_phone_39` text, `brit___learning_40` text, `brit___community_41` text, `brit___skills_42` text, `brit___learning__43` text, `brit___community_44` text, `brit___skills_45` text, `brit___tikkun_46` text, `learning_interests_47` text, `tikkun_interests_48` text, `community_interests_49` text, `tefillah_interests_50` text, `member_since_51` text, `upcoming_major_life_events_52` text, `nosherize_occasion_53` text, `nosherize_month_54` text, `hebrew_name_55` text, `partners_hebrew_name_56` text, `shabbat_walker_57` text, `_pledge_58` text, `_pledge_59` text, `employer_60` text, `occupation_61` text, `job_title__62` text, `undergraduate_universitycollege_63` text, `graduate_school_64` text, `wedding_anniversary_65` text, `names_of_children_66` text, `childstudent__first_name_67` text, `childstudent__middle_name_68` text, `childstudent__last_name_69` text, `childstudent__hebrew_name_70` text, `childstudent__mobile_phone_71` text, `childstudent__grade_in_school_72` text, `childstudent__school_name_73` text, `childstudent__date_of_birth_74` text, `childstudent__limudim_enrollment_75` text, `childstudent__barbat_mitzvah_date_76` text, `childstudent__name_of_school_77` text, `childstudent__limudim_class_78` text, `childstudent__grade_79` text, `childstudent__first_name_80` text, `childstudent__middle_name_81` text, `childstudent__last_name_82` text, `childstudent__hebrew_name_83` text, `childstudent__mobile_phone_84` text, `childstudent__date_of_birth_85` text, `childstudent__grade_in_school_86` text, `childstudent__name_of_school_87` text, `childstudent__limudim_enrollment_88` text, `childstudent__limudim_class_89` text, `childstudent__barbat_mitzvah_date_90` text, `childstudent__first_name_91` text, `childstudent__middle_name_92` text, `childstudent__last_name_93` text, `childstudent__hebrew_name_94` text, `childstudent__mobile_phone_95` text, `childstudent__date_of_birth_96` text, `childstudent__grade_in_school_97` text, `childstudent__name_of_school_98` text, `childstudent__limudim_enrollment_99` text, `childstudent__limudim_class_100` text, `childstudent__barbat_mitzvah_date_101` text, `childstudent__first_name_102` text, `childstudent__middle_name__103` text, `childstudent__last_name_104` text, `childstudent__hebrew_name_105` text, `childstudent__mobile_phone_106` text, `childstudent__date_of_birth_107` text, `childstudent__grade_in_school_108` text, `childstudent__name_of_school_109` text, `childstudent__limudim_enrollment_110` text, `childstudent__limudim_class_111` text, `childstudent__barbat_mitzvah_date_112` text, `emergency_contact__name_113` text, `emergency_contact__relationship_114` text, `emergency_contact__phone_number_115` text, `emergency_contact__name_116` text, `emergency_contact__relationship_117` text, `emergency_contact__phone_number_118` text, `physician_name_119` text, `physician_phone_number_120` text, `dentist_name_121` text, `dentist_phone_number_122` text, `medical_insurance_provider_123` text, `medical_insurance_group_124` text, `medical_insurance_plan_id_125` text, `if_the_injury_is_minor_give_my_children_first_aid_126` text, `i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127` text, `legal_guardians_initials_128` text, `date_129` text, `childstudent__allergies_130` text, `childstudent__medications_131` text, `childstudent__special_instructions_132` text, `childstudent__allergies__133` text, `childstudent__medications_134` text, `childstudent__special_instructions_135` text, `childstudent__allergies_136` text, `childstudent__medications_137` text, `childstudent__special_instructions_138` text, `childstudent__allergies_139` text, `childstudent__medications_140` text, `childstudent__special_instructions_141` text, `emergency_info_confirmed_142` text, `yahrzeit__first_name_143` text, `yahrzeit__last_name_144` text, `yahrzeit__hebrew_name_145` text, `yarzheit__relationship_146` text, `yarzheit__date_of_death_147` text, `yarzheit__jewish_date_of_death_148` text, `yarzheit__first_name_149` text, `yarzheit__last_name_150` text, `yarzheit__hebrew_name_151` text, `yarzheit__relationship_152` text, `yarzheit__date_of_death_153` text, `yarzheit__jewish_date_of_death_154` text, `yarzheit__first_name_155` text, `yarzheit__last_name_156` text, `yarzheit__hebrew_name_157` text, `yarzheit__relationship_158` text, `yarzheit__date_of_death_159` text, `yarzheit__jewish_date_of_death_160` text, `yarzheit__first_name_161` text, `yarzheit__last_name_162` text, `yarzheit__hebrew_name_163` text, `yarzheit__relationship_164` text, `yarzheit__date_of_death_165` text, `yarzheit__jewish_date_of_death_166` text, `yarzheit__first_name_167` text, `yarzheit__last_name_168` text, `yarzheit__hebrew_name_169` text, `yarzheit__relationship_170` text, `yarzheit__date_of_death_171` text, `yarzheit__jewish_date_of_death_172` text, `created_on_date_173` text, `last_modified_date_174` text, `last_login_date_175` text, `mc_parent_176` text, `mc_child_177` text) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1059 ** Identifier name 'i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127' is too long]
    [type] => DB_Error
    [user_info] => CREATE TABLE civicrm_import_job_7282127c8f2423e7aad72954fed7ee95 (`dup_basic_0` text, `username_1` text, `password_2` text, `contact_name_3` text, `group_4` text, `member_unit_5` text, `membership_type_6` text, `title_7` text, `first_name_8` text, `middle_name_9` text, `last_name_10` text, `photo_11` text, `email_12` text, `alternate_email_13` text, `primary_phone_number_14` text, `date_of_birth_15` text, `individual_notes_16` text, `about_me_17` text, `sex__18` text, `marital_status_19` text, `partners_first_name_20` text, `partners_last_name_21` text, `partners_email_22` text, `partners_primary_phone_number_23` text, `partners_date_of_birth_24` text, `ikar_experience_25` text, `neighborhood_26` text, `expiration_date_27` text, `street_address_28` text, `city_29` text, `state_30` text, `zipcode_31` text, `country_32` text, `home_phone_33` text, `work_phone_34` text, `work_phone_ext_35` text, `mobile_phone_36` text, `partners_work_phone_37` text, `partners_mobile_phone_38` text, `alternate_phone_39` text, `brit___learning_40` text, `brit___community_41` text, `brit___skills_42` text, `brit___learning__43` text, `brit___community_44` text, `brit___skills_45` text, `brit___tikkun_46` text, `learning_interests_47` text, `tikkun_interests_48` text, `community_interests_49` text, `tefillah_interests_50` text, `member_since_51` text, `upcoming_major_life_events_52` text, `nosherize_occasion_53` text, `nosherize_month_54` text, `hebrew_name_55` text, `partners_hebrew_name_56` text, `shabbat_walker_57` text, `_pledge_58` text, `_pledge_59` text, `employer_60` text, `occupation_61` text, `job_title__62` text, `undergraduate_universitycollege_63` text, `graduate_school_64` text, `wedding_anniversary_65` text, `names_of_children_66` text, `childstudent__first_name_67` text, `childstudent__middle_name_68` text, `childstudent__last_name_69` text, `childstudent__hebrew_name_70` text, `childstudent__mobile_phone_71` text, `childstudent__grade_in_school_72` text, `childstudent__school_name_73` text, `childstudent__date_of_birth_74` text, `childstudent__limudim_enrollment_75` text, `childstudent__barbat_mitzvah_date_76` text, `childstudent__name_of_school_77` text, `childstudent__limudim_class_78` text, `childstudent__grade_79` text, `childstudent__first_name_80` text, `childstudent__middle_name_81` text, `childstudent__last_name_82` text, `childstudent__hebrew_name_83` text, `childstudent__mobile_phone_84` text, `childstudent__date_of_birth_85` text, `childstudent__grade_in_school_86` text, `childstudent__name_of_school_87` text, `childstudent__limudim_enrollment_88` text, `childstudent__limudim_class_89` text, `childstudent__barbat_mitzvah_date_90` text, `childstudent__first_name_91` text, `childstudent__middle_name_92` text, `childstudent__last_name_93` text, `childstudent__hebrew_name_94` text, `childstudent__mobile_phone_95` text, `childstudent__date_of_birth_96` text, `childstudent__grade_in_school_97` text, `childstudent__name_of_school_98` text, `childstudent__limudim_enrollment_99` text, `childstudent__limudim_class_100` text, `childstudent__barbat_mitzvah_date_101` text, `childstudent__first_name_102` text, `childstudent__middle_name__103` text, `childstudent__last_name_104` text, `childstudent__hebrew_name_105` text, `childstudent__mobile_phone_106` text, `childstudent__date_of_birth_107` text, `childstudent__grade_in_school_108` text, `childstudent__name_of_school_109` text, `childstudent__limudim_enrollment_110` text, `childstudent__limudim_class_111` text, `childstudent__barbat_mitzvah_date_112` text, `emergency_contact__name_113` text, `emergency_contact__relationship_114` text, `emergency_contact__phone_number_115` text, `emergency_contact__name_116` text, `emergency_contact__relationship_117` text, `emergency_contact__phone_number_118` text, `physician_name_119` text, `physician_phone_number_120` text, `dentist_name_121` text, `dentist_phone_number_122` text, `medical_insurance_provider_123` text, `medical_insurance_group_124` text, `medical_insurance_plan_id_125` text, `if_the_injury_is_minor_give_my_children_first_aid_126` text, `i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127` text, `legal_guardians_initials_128` text, `date_129` text, `childstudent__allergies_130` text, `childstudent__medications_131` text, `childstudent__special_instructions_132` text, `childstudent__allergies__133` text, `childstudent__medications_134` text, `childstudent__special_instructions_135` text, `childstudent__allergies_136` text, `childstudent__medications_137` text, `childstudent__special_instructions_138` text, `childstudent__allergies_139` text, `childstudent__medications_140` text, `childstudent__special_instructions_141` text, `emergency_info_confirmed_142` text, `yahrzeit__first_name_143` text, `yahrzeit__last_name_144` text, `yahrzeit__hebrew_name_145` text, `yarzheit__relationship_146` text, `yarzheit__date_of_death_147` text, `yarzheit__jewish_date_of_death_148` text, `yarzheit__first_name_149` text, `yarzheit__last_name_150` text, `yarzheit__hebrew_name_151` text, `yarzheit__relationship_152` text, `yarzheit__date_of_death_153` text, `yarzheit__jewish_date_of_death_154` text, `yarzheit__first_name_155` text, `yarzheit__last_name_156` text, `yarzheit__hebrew_name_157` text, `yarzheit__relationship_158` text, `yarzheit__date_of_death_159` text, `yarzheit__jewish_date_of_death_160` text, `yarzheit__first_name_161` text, `yarzheit__last_name_162` text, `yarzheit__hebrew_name_163` text, `yarzheit__relationship_164` text, `yarzheit__date_of_death_165` text, `yarzheit__jewish_date_of_death_166` text, `yarzheit__first_name_167` text, `yarzheit__last_name_168` text, `yarzheit__hebrew_name_169` text, `yarzheit__relationship_170` text, `yarzheit__date_of_death_171` text, `yarzheit__jewish_date_of_death_172` text, `created_on_date_173` text, `last_modified_date_174` text, `last_login_date_175` text, `mc_parent_176` text, `mc_child_177` text) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1059 ** Identifier name 'i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127' is too long]
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TABLE civicrm_import_job_7282127c8f2423e7aad72954fed7ee95 (`dup_basic_0` text, `username_1` text, `password_2` text, `contact_name_3` text, `group_4` text, `member_unit_5` text, `membership_type_6` text, `title_7` text, `first_name_8` text, `middle_name_9` text, `last_name_10` text, `photo_11` text, `email_12` text, `alternate_email_13` text, `primary_phone_number_14` text, `date_of_birth_15` text, `individual_notes_16` text, `about_me_17` text, `sex__18` text, `marital_status_19` text, `partners_first_name_20` text, `partners_last_name_21` text, `partners_email_22` text, `partners_primary_phone_number_23` text, `partners_date_of_birth_24` text, `ikar_experience_25` text, `neighborhood_26` text, `expiration_date_27` text, `street_address_28` text, `city_29` text, `state_30` text, `zipcode_31` text, `country_32` text, `home_phone_33` text, `work_phone_34` text, `work_phone_ext_35` text, `mobile_phone_36` text, `partners_work_phone_37` text, `partners_mobile_phone_38` text, `alternate_phone_39` text, `brit___learning_40` text, `brit___community_41` text, `brit___skills_42` text, `brit___learning__43` text, `brit___community_44` text, `brit___skills_45` text, `brit___tikkun_46` text, `learning_interests_47` text, `tikkun_interests_48` text, `community_interests_49` text, `tefillah_interests_50` text, `member_since_51` text, `upcoming_major_life_events_52` text, `nosherize_occasion_53` text, `nosherize_month_54` text, `hebrew_name_55` text, `partners_hebrew_name_56` text, `shabbat_walker_57` text, `_pledge_58` text, `_pledge_59` text, `employer_60` text, `occupation_61` text, `job_title__62` text, `undergraduate_universitycollege_63` text, `graduate_school_64` text, `wedding_anniversary_65` text, `names_of_children_66` text, `childstudent__first_name_67` text, `childstudent__middle_name_68` text, `childstudent__last_name_69` text, `childstudent__hebrew_name_70` text, `childstudent__mobile_phone_71` text, `childstudent__grade_in_school_72` text, `childstudent__school_name_73` text, `childstudent__date_of_birth_74` text, `childstudent__limudim_enrollment_75` text, `childstudent__barbat_mitzvah_date_76` text, `childstudent__name_of_school_77` text, `childstudent__limudim_class_78` text, `childstudent__grade_79` text, `childstudent__first_name_80` text, `childstudent__middle_name_81` text, `childstudent__last_name_82` text, `childstudent__hebrew_name_83` text, `childstudent__mobile_phone_84` text, `childstudent__date_of_birth_85` text, `childstudent__grade_in_school_86` text, `childstudent__name_of_school_87` text, `childstudent__limudim_enrollment_88` text, `childstudent__limudim_class_89` text, `childstudent__barbat_mitzvah_date_90` text, `childstudent__first_name_91` text, `childstudent__middle_name_92` text, `childstudent__last_name_93` text, `childstudent__hebrew_name_94` text, `childstudent__mobile_phone_95` text, `childstudent__date_of_birth_96` text, `childstudent__grade_in_school_97` text, `childstudent__name_of_school_98` text, `childstudent__limudim_enrollment_99` text, `childstudent__limudim_class_100` text, `childstudent__barbat_mitzvah_date_101` text, `childstudent__first_name_102` text, `childstudent__middle_name__103` text, `childstudent__last_name_104` text, `childstudent__hebrew_name_105` text, `childstudent__mobile_phone_106` text, `childstudent__date_of_birth_107` text, `childstudent__grade_in_school_108` text, `childstudent__name_of_school_109` text, `childstudent__limudim_enrollment_110` text, `childstudent__limudim_class_111` text, `childstudent__barbat_mitzvah_date_112` text, `emergency_contact__name_113` text, `emergency_contact__relationship_114` text, `emergency_contact__phone_number_115` text, `emergency_contact__name_116` text, `emergency_contact__relationship_117` text, `emergency_contact__phone_number_118` text, `physician_name_119` text, `physician_phone_number_120` text, `dentist_name_121` text, `dentist_phone_number_122` text, `medical_insurance_provider_123` text, `medical_insurance_group_124` text, `medical_insurance_plan_id_125` text, `if_the_injury_is_minor_give_my_children_first_aid_126` text, `i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127` text, `legal_guardians_initials_128` text, `date_129` text, `childstudent__allergies_130` text, `childstudent__medications_131` text, `childstudent__special_instructions_132` text, `childstudent__allergies__133` text, `childstudent__medications_134` text, `childstudent__special_instructions_135` text, `childstudent__allergies_136` text, `childstudent__medications_137` text, `childstudent__special_instructions_138` text, `childstudent__allergies_139` text, `childstudent__medications_140` text, `childstudent__special_instructions_141` text, `emergency_info_confirmed_142` text, `yahrzeit__first_name_143` text, `yahrzeit__last_name_144` text, `yahrzeit__hebrew_name_145` text, `yarzheit__relationship_146` text, `yarzheit__date_of_death_147` text, `yarzheit__jewish_date_of_death_148` text, `yarzheit__first_name_149` text, `yarzheit__last_name_150` text, `yarzheit__hebrew_name_151` text, `yarzheit__relationship_152` text, `yarzheit__date_of_death_153` text, `yarzheit__jewish_date_of_death_154` text, `yarzheit__first_name_155` text, `yarzheit__last_name_156` text, `yarzheit__hebrew_name_157` text, `yarzheit__relationship_158` text, `yarzheit__date_of_death_159` text, `yarzheit__jewish_date_of_death_160` text, `yarzheit__first_name_161` text, `yarzheit__last_name_162` text, `yarzheit__hebrew_name_163` text, `yarzheit__relationship_164` text, `yarzheit__date_of_death_165` text, `yarzheit__jewish_date_of_death_166` text, `yarzheit__first_name_167` text, `yarzheit__last_name_168` text, `yarzheit__hebrew_name_169` text, `yarzheit__relationship_170` text, `yarzheit__date_of_death_171` text, `yarzheit__jewish_date_of_death_172` text, `created_on_date_173` text, `last_modified_date_174` text, `last_login_date_175` text, `mc_parent_176` text, `mc_child_177` text) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci [nativecode=1059 ** Identifier name 'i_authorize_the_staff_to_obtain_emergency_medical_treatment_for_my_children_127' is too long]"]
)

Any ideas on a work-around?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Import Contacts fails because of long custom field name
May 25, 2011, 02:35:10 pm
My current work-around is I changed the lines around 135 in "CRM/Import/DataSource/CSV.php"

$idx++;
      if(strlen (  $column) > 45 ){
         $column  = 'sample'.$idx;
      
      }else{               
                  $column = "`$column`";
                }

So far this change is not causing any issues, but I have not tested in with a variety of files.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import Contacts fails because of long custom field name

This forum was archived on 2017-11-26.