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

Sort by country on a search result generates a db fatal error

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.0.7
    • Fix Version/s: 4.1.0
    • Component/s: CiviCRM Search
    • Labels:
      None

      Description

      Hi,

      Steps to reproduce:
      go to the search page
      http://drupal.demo.civicrm.org/civicrm/contact/search

      search (no criteria)

      on the search result, click on the "country" header (to sort by country)

      Result:
      Sorry. A non-recoverable error has occurred.
      DB Error: no such field

      Database Error Code: Unknown column 'country' 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 d4aa8f8e30f8b40dffa83d3679348391_1614', 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_country ON civicrm_address.country_id = civicrm_country.id WHERE (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY country asc [nativecode=1054 ** Unknown column 'country' 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 d4aa8f8e30f8b40dffa83d3679348391_1614', 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_country ON civicrm_address.country_id = civicrm_country.id WHERE (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY country asc [nativecode=1054 ** Unknown column 'country' 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 d4aa8f8e30f8b40dffa83d3679348391_1614', 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_country ON civicrm_address.country_id = civicrm_country.id WHERE (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY country asc [nativecode=1054 ** Unknown column 'country' in 'order clause']"]

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: