Descending Sorting of Date Fields not possible

chris.gr - November 7, 2009 - 14:53
Project:Date
Version:6.x-2.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

I have a CKK date field. If I configure this field in a view to be sorted in a descending order, it is ignored:

the query always is ASC:
SELECT node.nid AS nid,
node_data_field_date.field_date_value AS node_data_field_date_field_date_value,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_date.field_veranstaltung_value AS node_data_field_date_field_veranstaltung_value,
node_data_field_date.field_veranstaltung_format AS node_data_field_date_field_veranstaltung_format,
node_data_field_date.field_info_value AS node_data_field_date_field_info_value,
node_data_field_date.field_info_format AS node_data_field_date_field_info_format,
node_data_field_date.field_zeit_value AS node_data_field_date_field_zeit_value,
node_data_field_date.field_zeit_format AS node_data_field_date_field_zeit_format,
node_data_field_date.field_ort_value AS node_data_field_date_field_ort_value,
node_data_field_extern_value_0.field_extern_value AS node_data_field_extern_value_0_field_extern_value
FROM node node
INNER JOIN content_type_termin node_data_field_extern_value_0 ON node.vid = node_data_field_extern_value_0.vid AND node_data_field_extern_value_0.field_extern_value = 1
LEFT JOIN content_type_termin node_data_field_date ON node.vid = node_data_field_date.vid
WHERE (node.type in ('termin')) AND (node_data_field_extern_value_0.field_extern_value = 1)
ORDER BY node_data_field_date_field_date_value ASC

CKK 6.x-2.5
Views: 6.x-2.6

#1

merlinofchaos - November 7, 2009 - 18:37
Project:Views» Date
Version:6.x-2.6» 6.x-2.x-dev
Component:exposed filters» Miscellaneous
Status:active» postponed (maintainer needs more info)

1) As per the submission guidelines which you should have read before clicking submit on this issue, this should have been filed against date.module, not Views.

2) Without an export of the view, I doubt anyone will be able to help you.

I can make a guess that you've got the view set to use the table style, and that the style has the date field as sortable and the default sort order is ascending, and it's set to override sorting if tablesorts are in use. But without an export of the view, that's only a guess.

#2

jonloh - November 24, 2009 - 06:23

Yeah, this happened to me as well, like what merlinofchaos said: It has to do with the Table's sort setting.

You have to set the Date field as default sort, and change the sorting order in there.

 
 

Drupal is a registered trademark of Dries Buytaert.