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

Adding custom activity to user

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      CiviCRM Build: March 13 (sorry I don't have the build number, let me know if it is stored in a file somewhere)
      Drupal: 4.7 cvs

      Task: Add activity to a contact record
      Expected Behavior: Fill out contact form, submit, activity is attached to record.
      Observed Behavior: Fill out form, submit, error message returned:

      ------------

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

      [code] => -3
      [message] => DB Error: constraint violation
      [mode] => 16
      [debug_info] => INSERT INTO civicrm_activity (source_contact_id , activity_type_id , target_entity_table , target_entity_id , subject , scheduled_date_time , duration_hours , duration_minutes , location , details , status ) VALUES ( 0 , 6 , 'civicrm_contact' , 4 , 'This is an example of mark\'s activity type' , 20060322150000 , 0 , 0 , 'here' , NULL , 'Scheduled' ) [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
      [type] => db_error
      [user_info] => INSERT INTO civicrm_activity (source_contact_id , activity_type_id , target_entity_table , target_entity_id , subject , scheduled_date_time , duration_hours , duration_minutes , location , details , status ) VALUES ( 0 , 6 , 'civicrm_contact' , 4 , 'This is an example of mark\'s activity type' , 20060322150000 , 0 , 0 , 'here' , NULL , 'Scheduled' ) [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
      [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_activity (source_contact_id , activity_type_id , target_entity_table , target_entity_id , subject , scheduled_date_time , duration_hours , duration_minutes , location , details , status ) VALUES ( 0 , 6 , 'civicrm_contact' , 4 , 'This is an example of mark\'s activity type' , 20060322150000 , 0 , 0 , 'here' , NULL , 'Scheduled' ) [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]"]
      )

      ------------

      Errors are thrown for both custom and standard activity types.

      I am unsure what foreign key this refers to. I will happily supply details from my mySQL tables if this would help.

      The database contains 20 test records, all successfully uploaded.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              mfredrickson Mark Fredrickson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: