I am making use of the Taxonomy Redirect module (http://drupal.org/project/taxonomy_redirect) that changes the URL for taxonomy terms displayed with a node. Unfortunately, Taxonomy List, which I also use, does not recognize this module. This simple patch uses a Taxonomy Redirect function to get the proper URL for redirected terms.

CommentFileSizeAuthor
taxonomy_list.module.1.1.patch1.95 KBbwong

Comments

mlncn’s picture

Category: feature » bug

Does this use a taxonomy_redirect specific function? It may not be necessary.

In any case, taxonomy_list should be using core Drupal's taxonomy_term_path

http://api.drupal.org/api/function/taxonomy_term_path/5

It should never assume that the path is taxonomy/term/

Using taxonomy_term_path() ensures modules that implement their own vocabularies, such as image and forum, will have their paths treated correctly in taxonomy_list.

I haven't looked at taxonomy_redirects code but might this approach fix that too? Changing to a bug because not giving proper paths for custom vocabularies interferes with core functionality.

mlncn’s picture

Status: Needs review » Needs work

Took a quick look at taxonomy_redirect's code.

It does use the method of taking "control" of a vocabulary away from the original module (usually taxonomy).

So that means in taxonomy_list the section we need to change -- complete with commented out parts that are more correct! -- is:

 //          .  '<div class="title"><a href="'. base_path() .'taxonomy/term/'. $term->tid .'">'. t($term->name)  .'</a></div>'
 //          .  '<div class="title"><a href="'. taxonomy_term_path($term) .'">'. t($term->name)  .'</a></div>'
-            .  '<div class="title">'. l(t($term->name), 'taxonomy/term/'. $term->tid) .'</div>'
+            .  '<div class="title">'. l(t($term->name), $tpath) .'</div>'

So the line we should replace all of these versions with is:

<div class="title">'. l(t($term->name), taxonomy_term_path($term)) .'</div>

(I've only quickly looked at bwong's patch and haven't checked if other places in the code need changing, but all that would need changing is the code used to output the path-- as long as taxonomy_term_path() is used, any module doing things the Drupal way, including taxonomy_redirect, will be honored. Bwong, Agaric will roll a patch if requested.)

nancydru’s picture

Assigned: Unassigned » nancydru

Benjamin, you are absolutely correct. When they allow me, this will be done. Now, I have to go everywhere I have hardcoded 'taxonomy/term' and fix it.

nancydru’s picture

Status: Needs work » Patch (to be ported)
nancydru’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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