taxonomy_term_path returns bad alias

lutegrass - October 13, 2009 - 01:54
Project:Site map
Version:6.x-1.2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

In some cases, calling taxonomy_term_path seems to return the wrong path. This line #478 in site_map.module:

$term_item .= l($term->name, ($cat_depth < 0) ? taxonomy_term_path($term) : "taxonomy/term/$term->tid/$cat_depth", array('attributes' => array('title' => $term-> description)));

could be simplified to:

$term_item .= l($term->name, ($cat_depth < 0) ? "taxonomy/term/$term->tid" : "taxonomy/term/$term->tid/$cat_depth", array('attributes' => array('title' => $term-> description)));

to avoid the bad path alias problem. Somehow, taxonomy term path is, for certain vocabularies, adding the domain name and / to the path. So, you end up with a path like http://www.drupal.org/www.drupal.org/someterm-path-alias. It only happens when I set the path depth setting to -1 in the sitemap config. It doesn't happen for all of my vocabs either, just the one that is not multiple select and only has one content type assigned. Very strange.

#1

frjo - October 13, 2009 - 05:37
Category:bug report» support request

I think you have some other module that is messing up the path.

Take a look in your database, table "vocabulary", and see what "module" is set to for each vocabulary. My guess is that it's something other than "taxonomy" for the ones that gives you problem.

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

#2

wiifm69 - November 2, 2009 - 21:59

Also having a similar issue with my taxonomy URL aliases. Have tried version 1.1 and the latest dev version 2, both producing the same (unfriendly) output (e.g. 'http://localhost/taxonomy/term/31/all' - instead of 'http://localhost/taxonomy/term/green/all').

I have checked the table in question in the drupal database, and the module for all 10 of my taxonomies is set to 'taxonomy'.

Can @lutegrass's code suggestion by implemented, or is there a better way to fix this issue?

#3

lasac - November 11, 2009 - 00:17
Version:6.x-1.1» 6.x-1.2

i have the same issue, aliases for taxonomy and vocabulary are ignores.

The only modules used for vocabulary are taxonomy and forum. Version 1.2

 
 

Drupal is a registered trademark of Dries Buytaert.