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

"non-recoverable error" when editing non-existent Drupal user

    Details

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

      Description

      If you visit /user/x/edit, where x is a non-existent user (yes, this happens), then CiviCRM throws a CRM_Core_Error

      " 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 '' at line 7, 1064"

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

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] => SELECT civicrm_contact.display_name, civicrm_email.email, civicrm_location.location_type_id, civicrm_location.id
      FROM civicrm_contact
      LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_location.entity_id AND
      civicrm_location.is_primary = 1)
      LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
      WHERE civicrm_contact.id = [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 '' at line 7]
      [type] => db_error
      [user_info] => SELECT civicrm_contact.display_name, civicrm_email.email, civicrm_location.location_type_id, civicrm_location.id
      FROM civicrm_contact
      LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_location.entity_id AND
      civicrm_location.is_primary = 1)
      LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
      WHERE civicrm_contact.id = [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 '' at line 7]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info=" SELECT civicrm_contact.display_name, civicrm_email.email, civicrm_location.location_type_id, civicrm_location.id
      FROM civicrm_contact
      LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_location.entity_id AND
      civicrm_location.is_primary = 1)
      LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
      WHERE civicrm_contact.id = [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 '' at line 7]"]
      )

      Seems like nitpicking, but it looks ugly, and, who knows, this traceback might expose some security flaw.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              krestivo ken restivo
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: