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

Import of 'Master ID' causes fatal instead of 'polite' error

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.4.4
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Funding Source:
      Needs Funding

      Description

      I was testing a different import on demo (trying to figure out how our customer was importing the word 'Array' into the communication_preference field. I didn't manage to replicate that. But I did find that if I exported a contact search from Demo & then tried to reimport it, accepting the system default for the column headed 'Master Address Belongs To' I wound up getting a fatal error on that field.

      Master Address Belongs To Iowa Music Network González family Home -Master Address Belongs To

      I only tested this on demo & I'm not sure whether it ties in at all with the recent api change to accept '0' for integer fields - hence I've put it to you, Coleman, in the first instance to see if you have any thoughts on that.

      This is not a problem for our customer - only something I observed investigating a different problem

      Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`civicrm_demo_drupal`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL), 1452
      Additional Details:

      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -3
      [message] => DB Error: constraint violation
      [mode] => 16
      [debug_info] => UPDATE civicrm_address SET contact_id = 7 , location_type_id = 1 , is_primary = 1 , is_billing = 0 , street_address = 'El Camino' , city = 'Cane Valley' , state_province_id = 1016 , postal_code = '42720' , country_id = 1228 , geo_code_1 = 37.121145 , geo_code_2 = -85.370926 , manual_geo_code = 0 , master_id = 0 WHERE ( civicrm_address.id = 24 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_demo_drupal`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
      [type] => DB_Error
      [user_info] => UPDATE civicrm_address SET contact_id = 7 , location_type_id = 1 , is_primary = 1 , is_billing = 0 , street_address = 'El Camino' , city = 'Cane Valley' , state_province_id = 1016 , postal_code = '42720' , country_id = 1228 , geo_code_1 = 37.121145 , geo_code_2 = -85.370926 , manual_geo_code = 0 , master_id = 0 WHERE ( civicrm_address.id = 24 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_demo_drupal`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
      [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE civicrm_address SET contact_id = 7 , location_type_id = 1 , is_primary = 1 , is_billing = 0 , street_address = 'El Camino' , city = 'Cane Valley' , state_province_id = 1016 , postal_code = '42720' , country_id = 1228 , geo_code_1 = 37.121145 , geo_code_2 = -85.370926 , manual_geo_code = 0 , master_id = 0 WHERE ( civicrm_address.id = 24 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_demo_drupal`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]
      )

        Attachments

          Activity

            People

            • Assignee:
              colemanw Coleman Watts
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: