Using a Taxonomy: Term ID argument with the Validator set to Term Name / Synonym Converted to Term ID requires a text argument, but with the Set the breadcrumb for the term parents option selected the breadcrumb links use the parent's term IDs, which are invalid arguments.

Example:
With terms "Exterior -> Siding -> Stucco" with IDs 25,26,27 respectively
When viewing projects/Stucco the breadcrumb links should be projects/Exterior and projects/Siding but are set to the invalid paths projects/25 and projects/26

Comments

ISPTraderChris’s picture

Has this been addressed in a subsequent release?

wjaspers’s picture

Version: 6.x-2.6 » 6.x-2.11
Status: Active » Needs review
Issue tags: +breadcrumb links, +breadcrumb paths

Confirm problem. Issue is still present in Views 2.11.

I also noticed in my top breadcrumb (not Home) is linking to "<static-phrase>/*".
Where is a static URL phrase for my "Page View", and "*" is actually an asterisk.

To repeat this issue:

  1. Create a view.
  2. Create a Page display
  3. Add a /% to the Page display's "Path" setting.
  4. Add an Argument to the view with the following options:
    • Argument Type: "Taxonomy: Term ID (with Depth)"
    • Set the Title: attribute to "%1".
    • Set the Breadcrumb: attribute to "%1", as well.
    • Action to take if argument is not present: Any setting yields the same results.
      (I used "Display all values" for our purposes here.)
    • Delete the Wildcard value; as well as the Wildcard title.
    • Under Validator Options, set the following:
      • Validator: Taxonomy term
      • Vocabularies: (set to whatever vocabs you have a taxonomy assigned to, or whatever's appropriate for your needs).
      • Argument Type: "Term name/synonym converted to Term ID"
      • Check the box: Transform dashes in URL to spaces in term name arguments
    • Action to take if argument does not validate: "Hide view/ Page not found (404)"
    • Depth: Any (For our purposes, I set mine to "1".)
    • Check the box "Set the breadcrumb for the term parents"...
  5. Save your argument.
  6. Save the view.
  7. Go to a path that includes a known taxonomy term... ie. http://myserver.foo/<static-phrase>/<taxonomy-term>
  8. Examine the URL's of the breadcrumbs.

I've tested this with "Use Drupal's taxonomy term path to create breadcrumb links" enabled (in the Argument settings) as well, and have received the same results.

Is this supposed to be part of Views' functionality?
Otherwise, there is the View Alias (http://drupal.org/project/view_alias) module--but it didn't seem to have any effect on the breadcrumb anchors.
Did I evaluate the wrong Type of view?

merlinofchaos’s picture

Status: Needs review » Active

'needs review' means there is a patch attached.

iamjon’s picture

StatusFileSize
new4.01 KB

wjaspers,
did you ever find a solution? if yes please post so others can benefit.
I'm attaching an export of view that I made following wjaspers instructions

A few things to add, the taxonomy structure has parents and children. I created 3 terms for the test. term1 didn't not have any children. term2 was the parent of term3.
term1 had tid of 48, term2 of 49, term3, 50
example.com/projects/48
example.com/projects/49
example.com/projects/50 - all resulted in 404

example.com/projects/term1 gave results. the breadcrumb lead to projects/*
example.com/projects/term2 gave results. the breadcrumb lead to projects/*
example.com/projects/term3 gave results. the breadcrumb lead to projects/* (term3) and projects/49 (term2)

dawehner’s picture

The issue would be fixed if you would have the validation but raw input available? So basically here "name" and not "tid".

I guess there was a patch for this, but i can't find it at the moment.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.45 KB

Here is a quick patch, please test it :)

PS: In general this argument code should perhaps moved into the argument handler.

dawehner’s picture

StatusFileSize
new1.48 KB

* Changed it to $argument->argument
* Added a check_plain around it.

iamjon’s picture

I tested it with views 2-dev and got the same results.

iamjon’s picture

Status: Needs review » Needs work
mustanggb’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)