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

Sorting on Role or Status in Find Participants causes DB error

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.2.3
    • Fix Version/s: 3.2.4
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      In the Find Participants page in Events, when a user clicks on either the Status or Role field to sort the report, they receive a database error (see below). Seems like the names of those fields are not matching the database.

      See lines 408 and 413 in CRM/Event/Selector/Search.php. Changing those to the correct field alias fixes the bug.

      Database Error Code: Unknown column 'participant_role_id' 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] => SELECT DISTINCT(contact_a.id) as contact_id, contact_a.contact_type as `contact_type`, contact_a.contact_sub_type as `contact_sub_type`, contact_a.sort_name as `sort_name`, contact_a.display_name as `display_name`, civicrm_event.id as event_id, civicrm_event.title as event_title, civicrm_event.start_date as event_start_date, civicrm_event.end_date as event_end_date, civicrm_participant.id as participant_id, civicrm_participant.fee_level as participant_fee_level, civicrm_participant.fee_amount as participant_fee_amount, civicrm_participant.fee_currency as participant_fee_currency, event_type.label as event_type, participant_status.label as participant_status, participant_role.label as participant_role, civicrm_participant.register_date as participant_register_date, civicrm_participant.source as participant_source, civicrm_note.note as participant_note, civicrm_participant.is_pay_later as participant_is_pay_later, civicrm_participant.is_test as participant_is_test, civicrm_participant.registered_by_id as participant_registered_by_id, discount_name.label as participant_discount_name, civicrm_value_food_preference_2.id as civicrm_value_food_preference_2_id, civicrm_value_food_preference_2.soup_selection_4 as custom_4 FROM civicrm_contact contact_a LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id
      LEFT JOIN civicrm_value_food_preference_2 ON civicrm_value_food_preference_2.entity_id = civicrm_participant.id LEFT JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type') LEFT JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id ) LEFT JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id ) LEFT JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.option_group_id ) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_participant' AND
      civicrm_participant.id = civicrm_note.entity_id ) LEFT JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role') LEFT JOIN civicrm_option_value participant_role ON (civicrm_participant.role_id = participant_role.value
      AND option_group_participant_role.id = participant_role.option_group_id ) LEFT JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id) WHERE ( civicrm_event.id = 1 AND civicrm_participant.is_test = 0 ) AND (contact_a.is_deleted = 0) ORDER BY participant_role_id asc LIMIT 0, 50 [nativecode=1054 ** Unknown column 'participant_role_id' in 'order clause']

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: