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

Sort by state fails on contact search results

    Details

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

      Description

      Reproduced on the demo system.

      Steps to repro:
      1. Search -> Find Contacts
      2. Click on State to sort results

      URL: http://drupal.demo.civicrm.org/civicrm/contact/search?_qf_Basic_display=true&qfKey=860fe5a75512e1cef0c85651ec1ce2d7_7683&force=1&crmSID=3_u

      DB Error: no such field

      Error Details
      Database Error Code: Unknown column 'state_province' in 'order clause', 1054
      Additional Details:

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

      [code] => -19
      [message] => DB Error: no such field
      [mode] => 16
      [debug_info] =>
      INSERT INTO civicrm_prevnext_cache ( entity_table, entity_id1, entity_id2, cacheKey, data )
      SELECT 'civicrm_contact', contact_a.id, contact_a.id, 'civicrm search 860fe5a75512e1cef0c85651ec1ce2d7_7683', contact_a.display_name
      FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id WHERE ( contact_a.contact_type IN ('Individual') ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY state_province asc [nativecode=1054 ** Unknown column 'state_province' in 'order clause']
      [type] => DB_Error
      [user_info] =>
      INSERT INTO civicrm_prevnext_cache ( entity_table, entity_id1, entity_id2, cacheKey, data )
      SELECT 'civicrm_contact', contact_a.id, contact_a.id, 'civicrm search 860fe5a75512e1cef0c85651ec1ce2d7_7683', contact_a.display_name
      FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id WHERE ( contact_a.contact_type IN ('Individual') ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY state_province asc [nativecode=1054 ** Unknown column 'state_province' in 'order clause']
      [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="
      INSERT INTO civicrm_prevnext_cache ( entity_table, entity_id1, entity_id2, cacheKey, data )
      SELECT 'civicrm_contact', contact_a.id, contact_a.id, 'civicrm search 860fe5a75512e1cef0c85651ec1ce2d7_7683', contact_a.display_name
      FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id WHERE ( contact_a.contact_type IN ('Individual') ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY state_province asc [nativecode=1054 ** Unknown column 'state_province' in 'order clause']"]
      )

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              epsilon9 Troy Meyers
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: