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

"DB Error: value count on row" when both merge options are selected on contact export

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.6, 3.4.7
    • Fix Version/s: 4.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Export -> Merge Options should be mutually exclusive because Merge contacts with same address ALSO merges household members.

      Change checkboxes into a set of radio buttons with default = "Do not merge" and modify Merge contacts label slightly to help clarify ("Merge All Contacts ....")

      Merge Options [ ] Do not merge
      [ ] Merge All Contacts with the Same Address
      [ ] Merge Household Members into their Households

      ---- original post ----
      Story: after searching for contact records, if you select some and then select "export contacts" from the actions drop down, the next step (step 2 of 3, which, by the way is really the only step, or if anything the second of 2) offers the options to:

      • Export Primary Fields or select fields to export
      • Merge Contacts with the Same Address
      • Merge Household Members into their Households
      • Exclude contacts with "do not mail" privacy, no street address, or who are deceased

      If you select both "merge contacts with the same address" AND "merge household members into their households", the following error will result.

      Database Error Code: Column count doesn't match value count at row 1, 1136
      Additional Details:
      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -22
      [message] => DB Error: value count on row
      [mode] => 16
      [debug_info] =>
      INSERT INTO civicrm_export_temp_fed22674b6defde0b91259491840f719 (id, civicrm_primary_id,contact_type,contact_sub_type,do_not_email,do_not_phone,do_not_mail,do_not_sms,do_not_trade,is_opt_out,legal_identifier,external_identifier,sort_name,display_name,nick_name,legal_name,image_url,preferred_communication_method,preferred_language,preferred_mail_format,hash,contact_source,first_name,middle_name,last_name,job_title,birth_date,is_deceased,deceased_date,household_name,organization_name,sic_code,user_unique_id,current_employer_id,contact_is_deleted,addressee,email_greeting,postal_greeting,gender,individual_prefix,individual_suffix,current_employer,location_type,street_address,street_number,street_number_suffix,street_name,street_unit,supplemental_address_1,supplemental_address_2,city,postal_code_suffix,postal_code,geo_code_1,geo_code_2,address_name,master_id,county,state_province,country,phone,phone_ext,email,on_hold,is_bulkmail,signature_text,signature_html,im_provider,im,openid,world_region,url,groups,tags,notes,phone_type_id,provider_id,state_province_id,postal_greeting_id,addressee_id,7_a_b_id,7_a_b_contact_type,7_a_b_contact_sub_type,7_a_b_do_not_email,7_a_b_do_not_phone,7_a_b_do_not_mail,7_a_b_do_not_sms,7_a_b_do_not_trade,7_a_b_is_opt_out,7_a_b_legal_identifier,7_a_b_external_identifier,7_a_b_sort_name,7_a_b_display_name,7_a_b_nick_name,7_a_b_legal_name,7_a_b_image_url,7_a_b_preferred_communication_method,7_a_b_preferred_language,7_a_b_preferred_mail_format,7_a_b_hash,7_a_b_source,7_a_b_first_name,7_a_b_middle_name,7_a_b_last_name,7_a_b_job_title,7_a_b_birth_date,7_a_b_is_deceased,7_a_b_deceased_date,7_a_b_household_name,7_a_b_organization_name,7_a_b_sic_code,7_a_b_user_unique_id,7_a_b_employer_id,7_a_b_is_deleted,7_a_b_addressee,7_a_b_email_greeting,7_a_b_postal_greeting,7_a_b_gender,7_a_b_individual_prefix,7_a_b_individual_suffix,7_a_b_current_employer,7_a_b_street_address,7_a_b_street_number,7_a_b_street_number_suffix,7_a_b_street_name,7_a_b_street_unit,7_a_b_supplemental_address_1,7_a_b_supplemental_address_2,7_a_b_city,7_a_b_postal_code_suffix,7_a_b_postal_code,7_a_b_geo_code_1,7_a_b_geo_code_2,7_a_b_address_name,7_a_b_master_id,7_a_b_county,7_a_b_state_province,7_a_b_country,7_a_b_phone,7_a_b_phone_ext,7_a_b_email,7_a_b_on_hold,7_a_b_is_bulkmail,7_a_b_signature_text,7_a_b_signature_html,7_a_b_im,7_a_b_openid,7_a_b_world_region,7_a_b_url,7_a_b_groups,7_a_b_tags,7_a_b_notes,7_a_b_phone_type,7_a_b_im_service_provider,7_a_b_state_province_id)
      VALUES (1,'2','Individual','','1','','','','','','','','Reynolds, Milan','Ms Milan M Reynolds Sr','','','','SMS','','Both','1355475187','','Milan','M','Reynolds','','2000-10-26','1','','','','','','','','Ms Milan M Reynolds Sr','Dear Milan','Dear Milan','Female','Ms.','Sr.','','Home','152Q States Path E','152','Q','States','','Payables Dept.','','Gales Creek','','97117','45.622824','-123.25977','','','Alameda','OR','United States','21097914','','','','','','','','','','America South, Central, North and Caribbean','','Newsletter Subscribers','','Organize the Terry Fox run','Phone','','1036','1','1','85','Household','','1','','','','1','','','','Melinda Smith\'s home','Melinda Smith\'s home','Smith\'s home','','','5','','Both','115336996','','','','','','','','','Melinda Smith\'s home','','','','','','Melinda Smith\'s home','Dear Melinda Smith\'s home','Dear Melinda Smith\'s home','','','','','862I Main Ln SW','862','I','Main','','Editorial Dept','','McHenry','','39561','30.704034','-89.15395','','','Alameda','MS','United States','35375511','','melindasmithshome@amazon.co.in','','','','','','','America South, Central, North and Caribbean','','','','Invite members for the Steve Prefontaine 10k dream run','Phone','Yahoo','1023','5','2')
      [nativecode=1136 ** Column count doesn't match value count at row 1]
      [type] => DB_Error
      [user_info] =>
      INSERT INTO civicrm_export_temp_fed22674b6defde0b91259491840f719 (id, civicrm_primary_id,contact_type,contact_sub_type,do_not_email,do_not_phone,do_not_mail,do_not_sms,do_not_trade,is_opt_out,legal_identifier,external_identifier,sort_name,display_name,nick_name,legal_name,image_url,preferred_communication_method,preferred_language,preferred_mail_format,hash,contact_source,first_name,middle_name,last_name,job_title,birth_date,is_deceased,deceased_date,household_name,organization_name,sic_code,user_unique_id,current_employer_id,contact_is_deleted,addressee,email_greeting,postal_greeting,gender,individual_prefix,individual_suffix,current_employer,location_type,street_address,street_number,street_number_suffix,street_name,street_unit,supplemental_address_1,supplemental_address_2,city,postal_code_suffix,postal_code,geo_code_1,geo_code_2,address_name,master_id,county,state_province,country,phone,phone_ext,email,on_hold,is_bulkmail,signature_text,signature_html,im_provider,im,openid,world_region,url,groups,tags,notes,phone_type_id,provider_id,state_province_id,postal_greeting_id,addressee_id,7_a_b_id,7_a_b_contact_type,7_a_b_contact_sub_type,7_a_b_do_not_email,7_a_b_do_not_phone,7_a_b_do_not_mail,7_a_b_do_not_sms,7_a_b_do_not_trade,7_a_b_is_opt_out,7_a_b_legal_identifier,7_a_b_external_identifier,7_a_b_sort_name,7_a_b_display_name,7_a_b_nick_name,7_a_b_legal_name,7_a_b_image_url,7_a_b_preferred_communication_method,7_a_b_preferred_language,7_a_b_preferred_mail_format,7_a_b_hash,7_a_b_source,7_a_b_first_name,7_a_b_middle_name,7_a_b_last_name,7_a_b_job_title,7_a_b_birth_date,7_a_b_is_deceased,7_a_b_deceased_date,7_a_b_household_name,7_a_b_organization_name,7_a_b_sic_code,7_a_b_user_unique_id,7_a_b_employer_id,7_a_b_is_deleted,7_a_b_addressee,7_a_b_email_greeting,7_a_b_postal_greeting,7_a_b_gender,7_a_b_individual_prefix,7_a_b_individual_suffix,7_a_b_current_employer,7_a_b_street_address,7_a_b_street_number,7_a_b_street_number_suffix,7_a_b_street_name,7_a_b_street_unit,7_a_b_supplemental_address_1,7_a_b_supplemental_address_2,7_a_b_city,7_a_b_postal_code_suffix,7_a_b_postal_code,7_a_b_geo_code_1,7_a_b_geo_code_2,7_a_b_address_name,7_a_b_master_id,7_a_b_county,7_a_b_state_province,7_a_b_country,7_a_b_phone,7_a_b_phone_ext,7_a_b_email,7_a_b_on_hold,7_a_b_is_bulkmail,7_a_b_signature_text,7_a_b_signature_html,7_a_b_im,7_a_b_openid,7_a_b_world_region,7_a_b_url,7_a_b_groups,7_a_b_tags,7_a_b_notes,7_a_b_phone_type,7_a_b_im_service_provider,7_a_b_state_province_id)
      VALUES (1,'2','Individual','','1','','','','','','','','Reynolds, Milan','Ms Milan M Reynolds Sr','','','','SMS','','Both','1355475187','','Milan','M','Reynolds','','2000-10-26','1','','','','','','','','Ms Milan M Reynolds Sr','Dear Milan','Dear Milan','Female','Ms.','Sr.','','Home','152Q States Path E','152','Q','States','','Payables Dept.','','Gales Creek','','97117','45.622824','-123.25977','','','Alameda','OR','United States','21097914','','','','','','','','','','America South, Central, North and Caribbean','','Newsletter Subscribers','','Organize the Terry Fox run','Phone','','1036','1','1','85','Household','','1','','','','1','','','','Melinda Smith\'s home','Melinda Smith\'s home','Smith\'s home','','','5','','Both','115336996','','','','','','','','','Melinda Smith\'s home','','','','','','Melinda Smith\'s home','Dear Melinda Smith\'s home','Dear Melinda Smith\'s home','','','','','862I Main Ln SW','862','I','Main','','Editorial Dept','','McHenry','','39561','30.704034','-89.15395','','','Alameda','MS','United States','35375511','','melindasmithshome@amazon.co.in','','','','','','','America South, Central, North and Caribbean','','','','Invite members for the Steve Prefontaine 10k dream run','Phone','Yahoo','1023','5','2')
      [nativecode=1136 ** Column count doesn't match value count at row 1]
      [to_string] => [db_error: message="DB Error: value count on row" code=-22 mode=callback callback=CRM_Core_Error::handle prefix="" info="
      INSERT INTO civicrm_export_temp_fed22674b6defde0b91259491840f719 (id, civicrm_primary_id,contact_type,contact_sub_type,do_not_email,do_not_phone,do_not_mail,do_not_sms,do_not_trade,is_opt_out,legal_identifier,external_identifier,sort_name,display_name,nick_name,legal_name,image_url,preferred_communication_method,preferred_language,preferred_mail_format,hash,contact_source,first_name,middle_name,last_name,job_title,birth_date,is_deceased,deceased_date,household_name,organization_name,sic_code,user_unique_id,current_employer_id,contact_is_deleted,addressee,email_greeting,postal_greeting,gender,individual_prefix,individual_suffix,current_employer,location_type,street_address,street_number,street_number_suffix,street_name,street_unit,supplemental_address_1,supplemental_address_2,city,postal_code_suffix,postal_code,geo_code_1,geo_code_2,address_name,master_id,county,state_province,country,phone,phone_ext,email,on_hold,is_bulkmail,signature_text,signature_html,im_provider,im,openid,world_region,url,groups,tags,notes,phone_type_id,provider_id,state_province_id,postal_greeting_id,addressee_id,7_a_b_id,7_a_b_contact_type,7_a_b_contact_sub_type,7_a_b_do_not_email,7_a_b_do_not_phone,7_a_b_do_not_mail,7_a_b_do_not_sms,7_a_b_do_not_trade,7_a_b_is_opt_out,7_a_b_legal_identifier,7_a_b_external_identifier,7_a_b_sort_name,7_a_b_display_name,7_a_b_nick_name,7_a_b_legal_name,7_a_b_image_url,7_a_b_preferred_communication_method,7_a_b_preferred_language,7_a_b_preferred_mail_format,7_a_b_hash,7_a_b_source,7_a_b_first_name,7_a_b_middle_name,7_a_b_last_name,7_a_b_job_title,7_a_b_birth_date,7_a_b_is_deceased,7_a_b_deceased_date,7_a_b_household_name,7_a_b_organization_name,7_a_b_sic_code,7_a_b_user_unique_id,7_a_b_employer_id,7_a_b_is_deleted,7_a_b_addressee,7_a_b_email_greeting,7_a_b_postal_greeting,7_a_b_gender,7_a_b_individual_prefix,7_a_b_individual_suffix,7_a_b_current_employer,7_a_b_street_address,7_a_b_street_number,7_a_b_street_number_suffix,7_a_b_street_name,7_a_b_street_unit,7_a_b_supplemental_address_1,7_a_b_supplemental_address_2,7_a_b_city,7_a_b_postal_code_suffix,7_a_b_postal_code,7_a_b_geo_code_1,7_a_b_geo_code_2,7_a_b_address_name,7_a_b_master_id,7_a_b_county,7_a_b_state_province,7_a_b_country,7_a_b_phone,7_a_b_phone_ext,7_a_b_email,7_a_b_on_hold,7_a_b_is_bulkmail,7_a_b_signature_text,7_a_b_signature_html,7_a_b_im,7_a_b_openid,7_a_b_world_region,7_a_b_url,7_a_b_groups,7_a_b_tags,7_a_b_notes,7_a_b_phone_type,7_a_b_im_service_provider,7_a_b_state_province_id)
      VALUES (1,'2','Individual','','1','','','','','','','','Reynolds, Milan','Ms Milan M Reynolds Sr','','','','SMS','','Both','1355475187','','Milan','M','Reynolds','','2000-10-26','1','','','','','','','','Ms Milan M Reynolds Sr','Dear Milan','Dear Milan','Female','Ms.','Sr.','','Home','152Q States Path E','152','Q','States','','Payables Dept.','','Gales Creek','','97117','45.622824','-123.25977','','','Alameda','OR','United States','21097914','','','','','','','','','','America South, Central, North and Caribbean','','Newsletter Subscribers','','Organize the Terry Fox run','Phone','','1036','1','1','85','Household','','1','','','','1','','','','Melinda Smith\'s home','Melinda Smith\'s home','Smith\'s home','','','5','','Both','115336996','','','','','','','','','Melinda Smith\'s home','','','','','','Melinda Smith\'s home','Dear Melinda Smith\'s home','Dear Melinda Smith\'s home','','','','','862I Main Ln SW','862','I','Main','','Editorial Dept','','McHenry','','39561','30.704034','-89.15395','','','Alameda','MS','United States','35375511','','melindasmithshome@amazon.co.in','','','','','','','America South, Central, North and Caribbean','','','','Invite members for the Steve Prefontaine 10k dream run','Phone','Yahoo','1023','5','2')
      [nativecode=1136 ** Column count doesn't match value count at row 1]"]
      )

      Steps to reproduce:
      1. search for contacts
      2. select contacts
      3. select "export contacts" from the actions drop down
      4. select "primary fields"
      5. select checkbox to "Merge Contacts with the Same Address"
      6. Merge Household Members into their Households
      7. Click the export button

      You will then get the error.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              gregoryheller Gregory Heller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: