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.
Comment | File | Size | Author |
---|---|---|---|
#5 | site_map-n602870-2.patch | 2.01 KB | DamienMcKenna |
#4 | site_map-n602870.patch | 1.92 KB | DamienMcKenna |
Comments
Comment #1
frjo CreditAttribution: frjo commentedI 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
Comment #2
wiifmAlso 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?
Comment #3
Michsk CreditAttribution: Michsk commentedi have the same issue, aliases for taxonomy and vocabulary are ignores.
The only modules used for vocabulary are taxonomy and forum. Version 1.2
Comment #4
DamienMcKennaHow about something like this? (site_map.module line 496 onwards)
Then change the $rss_link generation to:
(patch against DRUPAL-6--2 branch attached)
Comment #5
DamienMcKennaThe correct patch is attached.
Comment #6
srobert72 CreditAttribution: srobert72 commentedSubscribing
Comment #7
srobert72 CreditAttribution: srobert72 commented@DamienMcKenna
Thank for your patch
I've just tested #5 patch and here is feedback.
Taxonomy URL are properly written now.
But URL under Feed icons are always wrong.
Comment #8
srobert72 CreditAttribution: srobert72 commentedChanged to BugReport.
Site_map seems not compatible with PathAuto in this particular case.
Comment #9
srobert72 CreditAttribution: srobert72 commentedIs there any news ?
Really annoying because it duplicates all taxonomy URL for same term.
Result is very bad for SEO.
Comment #10
srobert72 CreditAttribution: srobert72 commentedVery strange, problem has disappeared...
But there was no patch commited in Sitemap module since I've posted comments in this issue.
Maybe it has been fixed by recent updates in another module like PathAuto.
@schaub123
@wiifm69
@lasac
@DamienMcKenna
Do you still reproduce this issue ?
Comment #11
vpapadim CreditAttribution: vpapadim commentedSubscribing
Comment #12
vpapadim CreditAttribution: vpapadim commentedthat worked for me! thanks for the patch
Comment #13
ressa CreditAttribution: ressa commentedThis is still happening in the latest version, 6.x-2.1 as well as 6.x-2.x-dev
The #5 patch:
Fixes taxonomy URLs.
Feed icons are still in the taxonomy/term/80/all/feed format.
Comment #14
everypcneed CreditAttribution: everypcneed commentedI was able to edit the file successfully and can confirm taxonomy terms are now updating correctly with PathAuto settings.