On Drupal 5.7 I created a vocabulary with multiple hierarchy to manage content. To let users navigate it with ease, I installed Taxonomy Menu to add a content navigation menu based on the hierarchy I made, then Views 5.x-1.6 to display contents as a table.

Following the Taxonomy Menu module README.txt, I created a view associated with it that makes use of the Vocabulary ID and Term ID arguments, and the combo nearly works - nearly.

As an example, let's say we have a tree that represents a Vocabulary multilevel structure in which content is associated both with term nodes and term leaves, as follows:

Vocabulary1+
           |
           +Term1----+
           | DocA    |
           | DocB    |
           |         |
           |         +Term3
           |           DocC
           |           DocD
           |
           +Term2
              DocE
              DocF

In other terms, content may be associated with every term in the vocabulary.

The generated Taxonomy Menu correctly represent the vocabulary tree, the "number of nodes per terms" is the total number of nodes under each term and all its children (should the chlldren be ignored?) but the contents associated to intermediate terms are not listed anyway.

As per the example above, I can list DocC and DocD clicking on the Term1(4)->Term3(2) menu link, DocE and DocF clicking on the Term2(2) menu link, but when I click on the Term1(4) menu nothing shows up.

If I define an URL for the same view used by Taxonomy Menu to display it as a page (let's say view/test), I can display all the documents in the tree manually typing each .../view/test/$vid/$sid URL, and going to .../view/test/1/1 shows the missing documents Taxonomy Menu is unable to.

So I guess it could be a Taxonomy Menu fault, but I cannot be positive about that...

Any hint, suggestion or anything?

CommentFileSizeAuthor
#1 221342.patch370 bytessean.mtm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sean.mtm’s picture

Category: support » bug
Status: Active » Needs review
FileSize
370 bytes

The problem is that when taxonomy_menu parses the arguments (categories/1/1) to figure out what vid & tid to send to the view it does a

$tid = explode('/', $_GET['q']);
$tid = db_escape_string(array_pop($tid));

$arguments[] = $vid;

// Only add the Term ID if its not the Vocabulary ID
if ($vid != $tid) {
  $arguments[] = $tid;
}

Which is really great when you're dealing with URLs like cat/5/23 and cat/1 but it's not so hot at picking up the case where you're looking at cat/1/1. The right thing to here looks more like...

$tid = explode('/', $_GET['q']);
$arg_count = count($tid);
$tid = db_escape_string(array_pop($tid));

$arguments[] = $vid;

// Only add the Term ID if its not the Vocabulary ID
if ($arg_count >= 3) {
  $arguments[] = $tid;
}

Submitting a patch against 5.x-1.03 - verified that no fix exists in 5.x or 6.x dev

scooper@drupal.org’s picture

I just tried the patch - result was that no content nodes appeared for any of my taxonomy terms with this patch. I have just one vocabulary, so they all start with category/1/. With the patch removed, content is displayed. I don't currently have content for 1/1 but would like the bug fixed. Has anyone had success with this patch?

pow’s picture

Issue tags: +taxonomy, +bug, +category, +1/1, +no content

Help! I still got the cat/1/1 problem!!!

How can i get this fixed? :-/

I thought i am crazy because every category worked fine unless one term. But now it makes a little sense (1/1)

The Patch does not work, it shoes no content at all.

Thank you

indytechcook’s picture

I plan on doing to D5 review this weekend. I will look at this issue then.

pow’s picture

Ok, i solved the problem. Just deleted the 1/1 and created a new one 1/13.

But a fix would be great! :)

Thank you!

indytechcook’s picture

pow, lol, that's one way to fix it. I'm working on D5 today. I should have a dev release by tomorrow.

arlinsandbulte’s picture

Status: Needs review » Closed (duplicate)
apaderno’s picture

Issue tags: -taxonomy, -bug, -category, -1/1, -no content

I am removing issue tags used from one to four issues. I apologize for bumping the issue.