Commit 2db13ed2 authored by merlinofchaos's avatar merlinofchaos

91665: Order By pretty much borked in PGSQL.

parent f9010e47
......@@ -9,6 +9,7 @@ Views 1.1-dev
o 92305: Remove broken distinct profile filter
o 93540: Don't use block title if no page title.
o 93493: Allow field labels to be turned off if item not sortable.
o 91665: Order By pretty much borked in PGSQL.
New features:
o New comment fields to allow more Views use of comments. [Egon Bianchet]
......
......@@ -28,7 +28,7 @@ function node_views_tables() {
'help' => t('Display the title of the node.'),
),
'nid' => array(
'name' => t('Node: Node ID'),
'name' => t('Node: ID'),
'sortable' => true,
'help' => t('Display the NID of a node.'),
),
......@@ -104,7 +104,7 @@ function node_views_tables() {
'help' => t('Sort by the submission date of the node.'),
),
'changed' => array(
'name' => t('Node: Last Updated Time'),
'name' => t('Node: Updated Time'),
'help' => t('Sort by the last update date of the node.'),
),
'sticky' => array(
......
......@@ -308,7 +308,9 @@ class _views_query {
if ($alias) {
$a = " AS $alias";
}
$this->fields[] = "$table$field$a";
if (!in_array("$table$field$a", $this->fields)) {
$this->fields[] = "$table$field$a";
}
}
/*
......@@ -361,10 +363,7 @@ class _views_query {
*/
function add_orderby($table, $field, $order, $alias = '') {
if (!$alias && $table) {
$alias = $table . ".";
}
elseif ($alias) {
$alias .= ".";
$alias = $table;
}
if ($table) {
......@@ -376,8 +375,9 @@ class _views_query {
}
foreach($field as $f) {
// $this->add_field($f, $table);
$this->orderby[] = "$alias$f $order";
$as = $alias . '_' . $f;
$this->add_field($f, $table, $as);
$this->orderby[] = "$as $order";
}
}
......
Markdown is supported
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