I came across this issue in 6.x-2.8 and verified it in 6.x-2.x-dev.

I created some multiple word taxonomy terms with mixed cases: Term One, Term TWO. I applied them to various pages.

I set up a view with a Taxonomy: Term argument as follows:

Title: %1
Action to take if argument is not present: Summary, sorted ascending
Case: No transform
Case in path: Lower case
√ Transform spaces to dashes in URL

I also added Taxonomy: Term, Node: Title, and Node: Body as fields.

Previewing the view without an argument gives me the summary list with links to the Terms (formatted in proper mixed case). Clicking on the link to Term TWO brings me to a display that shows the URL argument as "term-two" (proper) but further down in the query information area I am shown the title to be "term two" (not expected).

When the view is saved with a page display and a path the same behavior occurs.

Note: if the Case is changed to Upper case and the Case in path remains as Lower case, the expected behavior occurs: the summary list is in all caps, the URL argument is lower case with hyphens, and the page title is in all caps. The expected behavior happens with every option except for No transform when setting Case in path.

So, the bug is that when No transform is set for the Case, it is not respected when any of the Case in path options are set to something other than No transform.

Comments

merlinofchaos’s picture

Can you do me a favor and export a view that demonstrates this? It'll make it easier to work out which widgets exactly to set. =)

tommyk’s picture

No problem.

$view = new view;
$view->name = 'bug_test';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'name' => array(
    'label' => 'Term',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_taxonomy' => 0,
    'exclude' => 0,
    'id' => 'name',
    'table' => 'term_data',
    'field' => 'name',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'Title',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'body' => array(
    'label' => 'Body',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'body',
    'table' => 'node_revisions',
    'field' => 'body',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'name' => array(
    'default_action' => 'summary asc',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 1,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '%1',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'glossary' => 0,
    'limit' => '0',
    'case' => 'none',
    'path_case' => 'lower',
    'transform_dash' => 1,
    'add_table' => 0,
    'require_value' => 0,
    'id' => 'name',
    'table' => 'term_data',
    'field' => 'name',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'bug');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));

Hope that helps.

tommyk’s picture

Anything more I can do/supply for this issue?

esmerel’s picture

Took me a couple minutes to figure out what exactly this meant - but I can replicate it. I would expect that the title of the view remain the same, no matter which term I'd clicked (under normal circumstances)

Query
5
SELECT node.nid AS nid,
term_data.name AS term_data_name,
term_data.vid AS term_data_vid,
term_data.tid AS term_data_tid,
node.title AS node_title,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format
FROM node node
LEFT JOIN term_node term_node ON node.vid = term_node.vid
INNER JOIN term_data term_data ON term_node.tid = term_data.tid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE term_data.name = 'term two'

Title term two
Path This display has no path.

Letharion’s picture

Assigned: Unassigned » merlinofchaos
merlinofchaos’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Assigned: merlinofchaos » dawehner
Status: Active » Patch (to be ported)
StatusFileSize
new2.8 KB

Ok, the problem here is twofold:

1) The argument handler for this is the bare 'string' handler. When using the title, the bare string handler does not use the actual term. In fact, the actual term was never looked up. It just drops it straight into the query. This means if you put 'aaaaaa' into the view, you'd get a view titled 'aaaaa' with, likely, no results.

2) The solution I thought would work, adding the taxonomy validator, doesn't. There's an easy fix for that, thought. The reason the validator is a good idea is that, as per 1, the taxonomy term isn't loaded. The validator loads it. Using the validator for this prevents extra work from being done in the case where you want the validator (since that could cause it to load twice). The validator is smart and sets the title to the validated object.

Except in this case, it actually doesn't, and for no particularly good reason.

This doesn't need much of a review, but the patch should fix the problem.

Needs porting to 7.x as the patch doesn't apply there, unsurprisingly.

dawehner’s picture

Status: Patch (to be ported) » Fixed

Converted to d7.

The problem is the changed taxonomy integration and some changed code here.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.