I am fairly new to Drupal and this community and I am having a problem with the Views 6.x-2.8 module. I hope this is the right place to post this (rather than as an Issue). Please let me know if I should ask this somewhere else.
I've created a few views on my site using Views 6.x-2.8, but when I add a Sort criteria, no matter what field I add to sort by, it always sorts using the title of the node, and the SQL query always ends with:
"ORDER BY node_title ASC"
I assume this is the default, but I can't change it no matter what I do.
The view I'm working with is a list of uploaded PDF files with dates associated with the files (a custom CCK date field rather than the creation or upload date). I've tried sorting by other fields aside from the CCK fields, but nothing seems to change the last line of the SQL query. It's always
"ORDER BY node_title ASC"
I'm hoping this is a known problem. If there is more I should post to help others determine what the problem is, I'm happy to do so. I've searched the Issues and forums for people with similar problems but haven't found any. Thank you to anyone who can help.
Drupal 6.16
CCK 6.x-2.6
Views 6.x-2.8
Comments
=-=
it may help to export the view and pastebin or drupalbin it and link it to this forum post.
pastebin
Here is the code at pastebin as VM suggested. More code in there than I expected :-)
http://pastebin.com/uSuFfa9n
Thank you for the tip, VM.
??
I assume the following code is what is supposed to be dealing with the ORDER BY in the SQL query:
but it still generates
"ORDER BY node_title ASC"
?
I had the same issue - this explanation fixed it for me.
http://drupal.org/node/690374
Solved my issue
As this linked to thread discusses, if you have a default sort set for the view (under "Format" section Settings) then you can manipulate the Sort Criteria all you want and it will not affect the results. By checking the "None" radio button under "Default Sort" my configured sorting criteria took effect.