Incompatible with taxonomy_redirect

Created on 17 February 2012, almost 13 years ago
Updated 8 March 2024, 9 months ago
function theme_tagadelic_weighted($terms) {
  $output = '';
  foreach ($terms as $term) {
    $output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$term->weight", 'rel' => 'tag'))) ." \n";
  }
  return $output;
}

This function is incompatible with any module that hooks into the taxonomy system to override the path, for example taxonomy_redirect. Part of the code of taxonomy_redirect resets the weight of the term. I would recommend using variables to define each value required by l() before calling taxonomy_term_path(). The following should resolve the issue..

function theme_tagadelic_weighted($terms) {
  $output = '';
  foreach ($terms as $term) {
    $name = $term->name;
    $weight = $term->weight;
    $path = taxonomy_term_path($term);
    $output .= l($name, $path, array('attributes' => array('class' => "tagadelic level$weight", 'rel' => 'tag'))) ." \n";
  }
  return $output;
}
πŸ› Bug report
Status

Closed: outdated

Version

1.3

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain willeaton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'm closing it because the issue was created a long time ago without any further steps.

    if you still need it then raise a new one.
    thanks

Production build 0.71.5 2024