Commit 6f88725c authored by merlinofchaos's avatar merlinofchaos

#138642: Fix summary sorting for taxonomy letter and node letter arguments.

parent fd7e0092
...@@ -3,6 +3,11 @@ CHANGELOG for Views for Drupal 4.7 ...@@ -3,6 +3,11 @@ CHANGELOG for Views for Drupal 4.7
(Note: Order of changelog has been reversed to newest first, which is more (Note: Order of changelog has been reversed to newest first, which is more
common). common).
Views 4.7.x-1.6
Bugs fixed:
o #138642: Fix summary sorting for taxonomy letter and node letter arguments.
Views 4.7.x-1.6-beta5 Views 4.7.x-1.6-beta5
Bugs fixed: Bugs fixed:
o #140431: Taxonomy select boxes were improperly showing descriptions. o #140431: Taxonomy select boxes were improperly showing descriptions.
......
...@@ -499,15 +499,16 @@ function views_handler_arg_nodetype($op, &$query, $argtype, $arg = '') { ...@@ -499,15 +499,16 @@ function views_handler_arg_nodetype($op, &$query, $argtype, $arg = '') {
} }
function views_handler_arg_nodeletter($op, &$query, $argtype, $arg = '') { function views_handler_arg_nodeletter($op, &$query, $argtype, $arg = '') {
static $field;
switch($op) { switch($op) {
case 'summary': case 'summary':
$len = intval($arg); $len = intval($arg);
$fieldinfo['field'] = ($len <= 0 ? "node.title" : $fieldinfo['field'] = "LEFT(node.title, $len)"); $field = $fieldinfo['field'] = ($len <= 0 ? "node.title" : $fieldinfo['field'] = "LEFT(node.title, $len)");
$fieldinfo['fieldname'] = 'letter'; $fieldinfo['fieldname'] = 'letter';
return $fieldinfo; return $fieldinfo;
break; break;
case 'sort': case 'sort':
$query->add_orderby('node', 'title', $argtype); $query->add_orderby('', $field, $argtype, 'letter');
break; break;
case 'filter': case 'filter':
$len = intval($argtype['options']); $len = intval($argtype['options']);
......
...@@ -373,11 +373,12 @@ function views_handler_arg_vocid($op, &$query, $argtype, $arg = '') { ...@@ -373,11 +373,12 @@ function views_handler_arg_vocid($op, &$query, $argtype, $arg = '') {
} }
function views_handler_arg_taxletter($op, &$query, $argtype, $arg = '') { function views_handler_arg_taxletter($op, &$query, $argtype, $arg = '') {
static $field;
switch($op) { switch($op) {
case 'summary': case 'summary':
$query->add_table('term_data', true); $query->add_table('term_data', true);
$len = intval($arg); $len = intval($arg);
$fieldinfo['field'] = ($len <= 0 ? "term_data.name" : "LEFT(term_data.name, $len)"); $field = $fieldinfo['field'] = ($len <= 0 ? "term_data.name" : "LEFT(term_data.name, $len)");
$fieldinfo['fieldname'] = 'letter'; $fieldinfo['fieldname'] = 'letter';
$query->add_field('tid', 'term_data'); $query->add_field('tid', 'term_data');
...@@ -385,7 +386,7 @@ function views_handler_arg_taxletter($op, &$query, $argtype, $arg = '') { ...@@ -385,7 +386,7 @@ function views_handler_arg_taxletter($op, &$query, $argtype, $arg = '') {
return $fieldinfo; return $fieldinfo;
break; break;
case 'sort': case 'sort':
$query->add_orderby('term_data', 'name', $argtype); $query->add_orderby('', $field, $argtype, 'letter');
break; break;
case 'filter': case 'filter':
$len = intval($argtype['options']); $len = intval($argtype['options']);
......
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