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

Add contact to organization action fatal error

    Details

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

      Description

      I'm using snapshot 2496 for PHP4 (using 4.1). The following process creates a fatal error:

      1) check the selection checkbox next to a contact
      2) select "add contacts to organization" from the actions pulldown menu
      3) click Go
      4) enter search text to find an organization
      5) click search button
      6) check the radio button next to the organization I want to add the contact to
      7) click "add to organization"

      The next screen is an error screen:
      Sorry. A non-recoverable error has occurred.

      Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR , 1064

      Return to CiviCRM menu.

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

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] => SELECT id
      FROM civicrm_relationship
      WHERE relationship_type_id = AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR
      ( contact_id_a = 2528 AND contact_id_b = 1263 )
      ) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR]
      [type] => db_error
      [user_info] => SELECT id
      FROM civicrm_relationship
      WHERE relationship_type_id = AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR
      ( contact_id_a = 2528 AND contact_id_b = 1263 )
      ) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info=" SELECT id
      FROM civicrm_relationship
      WHERE relationship_type_id = AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR
      ( contact_id_a = 2528 AND contact_id_b = 1263 )
      ) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ( ( contact_id_a = 1263 AND contact_id_b = 2528 ) OR]"]
      </pre>

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              Anonymous
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: