Commit 411ccc59 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Fix issue where past filter had stopped sorting in reverse cronological order

parent 0f59f296
......@@ -181,11 +181,11 @@ function uw_ct_event_views_query_alter(&$view, &$query) {
}
// Modify query for 'Past' to sort by desc
if ($view->exposed_raw_input['date'] == 'Past') {
if ($query->orderby[0]['field'] == 'field_data_field_event_date_field_event_date_value') {
$query->orderby[0]['direction'] = 'DESC';
}
if ($query->orderby[1]['field'] == 'field_data_field_event_date_field_event_date_value2') {
$query->orderby[1]['direction'] = 'DESC';
foreach ($query->orderby as $key => $data) {
// We search for these fields so that it doesn't matter where they are; they moved once and broke this.
if ($data['field'] == 'field_data_field_event_date_field_event_date_value' || $data['field'] == 'field_data_field_event_date_field_event_date_value2') {
$query->orderby[$key]['direction'] = 'DESC';
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment