When using a module that rewrites the taxonomy term path (eg http://drupal.org/project/taxonomy_redirect ), the vocabindex module still uses the standard drupal link (taxonomy/term/-tid-).

This is solved by using

taxonomy_term_path(taxonomy_get_term($tid));

instead of

drupal_get_path_alias(url('taxonomy/term/' . $tid));

in the function vocabindex_term_get_path() in the file vocabindex.view.inc

greetz,
Wim

CommentFileSizeAuthor
term_url.patch417 bytesCauliflower

Comments

xano’s picture

Status: Needs review » Needs work

What about a combination? This checks for modified term paths first and path aliases second and only returns the taxonomy default path if none of the two checks returned a modified path or an alias.

 function vocabindex_term_get_path($tid) {
  $default = 'taxonomy/term/' . $tid.
  $term_path = taxonomy_term_path($tid);
  if ($term_path == $default) {
    return drupal_get_path_alias(url($default));
  }
  else {
    return $term_path;
  }
}
xano’s picture

This would be even better:

function vocabindex_term_get_path($tid) {
  return drupal_get_path_alias(url(taxonomy_term_path($tid)));
}
xano’s picture

Assigned: Unassigned » xano
Status: Needs work » Fixed

Fixed and committed to 5.x-2.x-dev, 6.x-2.x-dev and 7.x-2.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

xano’s picture

Assigned: xano » Unassigned