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
(Note: Order of changelog has been reversed to newest first, which is more
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
Bugs fixed:
o #140431: Taxonomy select boxes were improperly showing descriptions.
......
......@@ -499,15 +499,16 @@ function views_handler_arg_nodetype($op, &$query, $argtype, $arg = '') {
}
function views_handler_arg_nodeletter($op, &$query, $argtype, $arg = '') {
static $field;
switch($op) {
case 'summary':
$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';
return $fieldinfo;
break;
case 'sort':
$query->add_orderby('node', 'title', $argtype);
$query->add_orderby('', $field, $argtype, 'letter');
break;
case 'filter':
$len = intval($argtype['options']);
......
......@@ -373,11 +373,12 @@ function views_handler_arg_vocid($op, &$query, $argtype, $arg = '') {
}
function views_handler_arg_taxletter($op, &$query, $argtype, $arg = '') {
static $field;
switch($op) {
case 'summary':
$query->add_table('term_data', true);
$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';
$query->add_field('tid', 'term_data');
......@@ -385,7 +386,7 @@ function views_handler_arg_taxletter($op, &$query, $argtype, $arg = '') {
return $fieldinfo;
break;
case 'sort':
$query->add_orderby('term_data', 'name', $argtype);
$query->add_orderby('', $field, $argtype, 'letter');
break;
case 'filter':
$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