Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8205

Import wizard does not validate length of column names for Create Table step

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 3.3.6
    • Fix Version/s: 4.4.0
    • Component/s: None
    • Labels:
      None

      Description

      I get the very long error message below.

      "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
      )

      => 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_learning43` 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_title62` text, `undergraduate_universitycollege_63` text, `graduate_school_64` text, `wedding_anniversary_65` text, `names_of_children_66` text, `childstudentfirst_name_67` text, `childstudentmiddle_name_68` text, `childstudentlast_name_69` text, `childstudenthebrew_name_70` text, `childstudentmobile_phone_71` text, `childstudentgrade_in_school_72` text, `childstudentschool_name_73` text, `childstudentdate_of_birth_74` text, `childstudentlimudim_enrollment_75` text, `childstudentbarbat_mitzvah_date_76` text, `childstudentname_of_school_77` text, `childstudentlimudim_class_78` text, `childstudentgrade_79` text, `childstudentfirst_name_80` text, `childstudentmiddle_name_81` text, `childstudentlast_name_82` text, `childstudenthebrew_name_83` text, `childstudentmobile_phone_84` text, `childstudentdate_of_birth_85` text, `childstudentgrade_in_school_86` text, `childstudentname_of_school_87` text, `childstudentlimudim_enrollment_88` text, `childstudentlimudim_class_89` text, `childstudentbarbat_mitzvah_date_90` text, `childstudentfirst_name_91` text, `childstudentmiddle_name_92` text, `childstudentlast_name_93` text, `childstudenthebrew_name_94` text, `childstudentmobile_phone_95` text, `childstudentdate_of_birth_96` text, `childstudentgrade_in_school_97` text, `childstudentname_of_school_98` text, `childstudentlimudim_enrollment_99` text, `childstudentlimudim_class_100` text, `childstudentbarbat_mitzvah_date_101` text, `childstudentfirst_name_102` text, `childstudentmiddle_name103` text, `childstudentlast_name_104` text, `childstudenthebrew_name_105` text, `childstudentmobile_phone_106` text, `childstudentdate_of_birth_107` text, `childstudentgrade_in_school_108` text, `childstudentname_of_school_109` text, `childstudentlimudim_enrollment_110` text, `childstudentlimudim_class_111` text, `childstudentbarbat_mitzvah_date_112` text, `emergency_contactname_113` text, `emergency_contactrelationship_114` text, `emergency_contactphone_number_115` text, `emergency_contactname_116` text, `emergency_contactrelationship_117` text, `emergency_contactphone_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, `childstudentallergies_130` text, `childstudentmedications_131` text, `childstudentspecial_instructions_132` text, `childstudentallergies133` text, `childstudentmedications_134` text, `childstudentspecial_instructions_135` text, `childstudentallergies_136` text, `childstudentmedications_137` text, `childstudentspecial_instructions_138` text, `childstudentallergies_139` text, `childstudentmedications_140` text, `childstudentspecial_instructions_141` text, `emergency_info_confirmed_142` text, `yahrzeitfirst_name_143` text, `yahrzeitlast_name_144` text, `yahrzeithebrew_name_145` text, `yarzheitrelationship_146` text, `yarzheitdate_of_death_147` text, `yarzheitjewish_date_of_death_148` text, `yarzheitfirst_name_149` text, `yarzheitlast_name_150` text, `yarzheithebrew_name_151` text, `yarzheitrelationship_152` text, `yarzheitdate_of_death_153` text, `yarzheitjewish_date_of_death_154` text, `yarzheitfirst_name_155` text, `yarzheitlast_name_156` text, `yarzheithebrew_name_157` text, `yarzheitrelationship_158` text, `yarzheitdate_of_death_159` text, `yarzheitjewish_date_of_death_160` text, `yarzheitfirst_name_161` text, `yarzheitlast_name_162` text, `yarzheithebrew_name_163` text, `yarzheitrelationship_164` text, `yarzheitdate_of_death_165` text, `yarzheitjewish_date_of_death_166` text, `yarzheitfirst_name_167` text, `yarzheitlast_name_168` text, `yarzheithebrew_name_169` text, `yarzheitrelationship_170` text, `yarzheitdate_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_learning43` 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_title62` text, `undergraduate_universitycollege_63` text, `graduate_school_64` text, `wedding_anniversary_65` text, `names_of_children_66` text, `childstudentfirst_name_67` text, `childstudentmiddle_name_68` text, `childstudentlast_name_69` text, `childstudenthebrew_name_70` text, `childstudentmobile_phone_71` text, `childstudentgrade_in_school_72` text, `childstudentschool_name_73` text, `childstudentdate_of_birth_74` text, `childstudentlimudim_enrollment_75` text, `childstudentbarbat_mitzvah_date_76` text, `childstudentname_of_school_77` text, `childstudentlimudim_class_78` text, `childstudentgrade_79` text, `childstudentfirst_name_80` text, `childstudentmiddle_name_81` text, `childstudentlast_name_82` text, `childstudenthebrew_name_83` text, `childstudentmobile_phone_84` text, `childstudentdate_of_birth_85` text, `childstudentgrade_in_school_86` text, `childstudentname_of_school_87` text, `childstudentlimudim_enrollment_88` text, `childstudentlimudim_class_89` text, `childstudentbarbat_mitzvah_date_90` text, `childstudentfirst_name_91` text, `childstudentmiddle_name_92` text, `childstudentlast_name_93` text, `childstudenthebrew_name_94` text, `childstudentmobile_phone_95` text, `childstudentdate_of_birth_96` text, `childstudentgrade_in_school_97` text, `childstudentname_of_school_98` text, `childstudentlimudim_enrollment_99` text, `childstudentlimudim_class_100` text, `childstudentbarbat_mitzvah_date_101` text, `childstudentfirst_name_102` text, `childstudentmiddle_name103` text, `childstudentlast_name_104` text, `childstudenthebrew_name_105` text, `childstudentmobile_phone_106` text, `childstudentdate_of_birth_107` text, `childstudentgrade_in_school_108` text, `childstudentname_of_school_109` text, `childstudentlimudim_enrollment_110` text, `childstudentlimudim_class_111` text, `childstudentbarbat_mitzvah_date_112` text, `emergency_contactname_113` text, `emergency_contactrelationship_114` text, `emergency_contactphone_number_115` text, `emergency_contactname_116` text, `emergency_contactrelationship_117` text, `emergency_contactphone_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, `childstudentallergies_130` text, `childstudentmedications_131` text, `childstudentspecial_instructions_132` text, `childstudentallergies133` text, `childstudentmedications_134` text, `childstudentspecial_instructions_135` text, `childstudentallergies_136` text, `childstudentmedications_137` text, `childstudentspecial_instructions_138` text, `childstudentallergies_139` text, `childstudentmedications_140` text, `childstudentspecial_instructions_141` text, `emergency_info_confirmed_142` text, `yahrzeitfirst_name_143` text, `yahrzeitlast_name_144` text, `yahrzeithebrew_name_145` text, `yarzheitrelationship_146` text, `yarzheitdate_of_death_147` text, `yarzheitjewish_date_of_death_148` text, `yarzheitfirst_name_149` text, `yarzheitlast_name_150` text, `yarzheithebrew_name_151` text, `yarzheitrelationship_152` text, `yarzheitdate_of_death_153` text, `yarzheitjewish_date_of_death_154` text, `yarzheitfirst_name_155` text, `yarzheitlast_name_156` text, `yarzheithebrew_name_157` text, `yarzheitrelationship_158` text, `yarzheitdate_of_death_159` text, `yarzheitjewish_date_of_death_160` text, `yarzheitfirst_name_161` text, `yarzheitlast_name_162` text, `yarzheithebrew_name_163` text, `yarzheitrelationship_164` text, `yarzheitdate_of_death_165` text, `yarzheitjewish_date_of_death_166` text, `yarzheitfirst_name_167` text, `yarzheitlast_name_168` text, `yarzheithebrew_name_169` text, `yarzheitrelationship_170` text, `yarzheitdate_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_learning43` 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_title62` text, `undergraduate_universitycollege_63` text, `graduate_school_64` text, `wedding_anniversary_65` text, `names_of_children_66` text, `childstudentfirst_name_67` text, `childstudentmiddle_name_68` text, `childstudentlast_name_69` text, `childstudenthebrew_name_70` text, `childstudentmobile_phone_71` text, `childstudentgrade_in_school_72` text, `childstudentschool_name_73` text, `childstudentdate_of_birth_74` text, `childstudentlimudim_enrollment_75` text, `childstudentbarbat_mitzvah_date_76` text, `childstudentname_of_school_77` text, `childstudentlimudim_class_78` text, `childstudentgrade_79` text, `childstudentfirst_name_80` text, `childstudentmiddle_name_81` text, `childstudentlast_name_82` text, `childstudenthebrew_name_83` text, `childstudentmobile_phone_84` text, `childstudentdate_of_birth_85` text, `childstudentgrade_in_school_86` text, `childstudentname_of_school_87` text, `childstudentlimudim_enrollment_88` text, `childstudentlimudim_class_89` text, `childstudentbarbat_mitzvah_date_90` text, `childstudentfirst_name_91` text, `childstudentmiddle_name_92` text, `childstudentlast_name_93` text, `childstudenthebrew_name_94` text, `childstudentmobile_phone_95` text, `childstudentdate_of_birth_96` text, `childstudentgrade_in_school_97` text, `childstudentname_of_school_98` text, `childstudentlimudim_enrollment_99` text, `childstudentlimudim_class_100` text, `childstudentbarbat_mitzvah_date_101` text, `childstudentfirst_name_102` text, `childstudentmiddle_name103` text, `childstudentlast_name_104` text, `childstudenthebrew_name_105` text, `childstudentmobile_phone_106` text, `childstudentdate_of_birth_107` text, `childstudentgrade_in_school_108` text, `childstudentname_of_school_109` text, `childstudentlimudim_enrollment_110` text, `childstudentlimudim_class_111` text, `childstudentbarbat_mitzvah_date_112` text, `emergency_contactname_113` text, `emergency_contactrelationship_114` text, `emergency_contactphone_number_115` text, `emergency_contactname_116` text, `emergency_contactrelationship_117` text, `emergency_contactphone_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, `childstudentallergies_130` text, `childstudentmedications_131` text, `childstudentspecial_instructions_132` text, `childstudentallergies133` text, `childstudentmedications_134` text, `childstudentspecial_instructions_135` text, `childstudentallergies_136` text, `childstudentmedications_137` text, `childstudentspecial_instructions_138` text, `childstudentallergies_139` text, `childstudentmedications_140` text, `childstudentspecial_instructions_141` text, `emergency_info_confirmed_142` text, `yahrzeitfirst_name_143` text, `yahrzeitlast_name_144` text, `yahrzeithebrew_name_145` text, `yarzheitrelationship_146` text, `yarzheitdate_of_death_147` text, `yarzheitjewish_date_of_death_148` text, `yarzheitfirst_name_149` text, `yarzheitlast_name_150` text, `yarzheithebrew_name_151` text, `yarzheitrelationship_152` text, `yarzheitdate_of_death_153` text, `yarzheitjewish_date_of_death_154` text, `yarzheitfirst_name_155` text, `yarzheitlast_name_156` text, `yarzheithebrew_name_157` text, `yarzheitrelationship_158` text, `yarzheitdate_of_death_159` text, `yarzheitjewish_date_of_death_160` text, `yarzheitfirst_name_161` text, `yarzheitlast_name_162` text, `yarzheithebrew_name_163` text, `yarzheitrelationship_164` text, `yarzheitdate_of_death_165` text, `yarzheitjewish_date_of_death_166` text, `yarzheitfirst_name_167` text, `yarzheitlast_name_168` text, `yarzheithebrew_name_169` text, `yarzheitrelationship_170` text, `yarzheitdate_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]"]
      )

      What is also strange is the custom field column name in question no longer exists. It seems like custom field groups/fields are being cached.

      What I did as a temporary fix in my install ( version 3.3.5):

      I changed the lines around 135 in "CRM/Import/DataSource/CSV.php"

      $idx++;
      if(strlen ( $column) > 45 )

      { $column = 'sample'.$idx; }

      else

      { $column = "`$column`"; }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              sgladstone Sarah Gladstone
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: