Closed (fixed)
Project:
Tagadelic
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2009 at 14:12 UTC
Updated:
28 Sep 2012 at 09:41 UTC
Jump to comment: Most recent file
I have a somewhat odd error, which means that whenever I have a tag cloud which is redirected with the taxonomy_redirect module, all tags are rendered with the class "level0"
I can follow the code all the way through, and the level shows correctly in the term object. But whenever it is put through the theming function
$output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$term->weight", 'rel' => 'tag'))) ." \n";
it suddenly turns to zero. For the tag clouds which are not redirected it works fine.
I have also found a workaround, so changing the line from the above to:
$weight = $term->weight;
$output .= l($term->name, taxonomy_term_path($term), array('attributes' => array('class' => "tagadelic level$weight", 'rel' => 'tag'))) ." \n";
makes it render correctly. I am not sure this is the right way to fix it, nor am I exactly sure why it fails. It might be the php implementation? If anyone can come up with an explanation I would love to hear it.
/Edlund
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | tagadelic.patch | 819 bytes | jazzslider |
| #1 | tagadelic.patch | 878 bytes | jazzslider |
Comments
Comment #1
jazzslider commentedI've gone ahead and posted a patch including the fix mentioned by @Edlund. Tested in combination with taxonomy_redirect, and it works perfectly.
Note that my patch doesn't include anything that @Edlund didn't already mentioned; I just figured submitting a formal patch might help speed along the inclusion of this fix into the next release. Hope this helps!
Comment #2
jazzslider commentedSorry, misunderstood the status descriptions; changing back to needs review.
Comment #3
Bèr Kessels commentedpatch fails against most recent 6.x version. We committed some other patches that conflict with this one, sorry. Please reroll.
Furthermore: I cannot see what taxonomy_redirect module has to do with this patch. The patch makes sense for certain php-versions that behave different on parsing on variables in "".
Alternative is to put {} around the variable: "foo term{$term->weight}".
Comment #4
nirad commentedI am using taxonomy redirect and I had the same problem and I can confirm that this patch fixed it on version 1.2.
Comment #5
citronica commentedPatch worked fine for me on Tagadelic 6.x-1.2 and Drupal 6.12. Thanks!
Comment #6
momper commentedsubscribe
Comment #7
jazzslider commentedHello!
Confirmed that the issue still exists with latest dev version of tagadelic in combination with latest dev version of taxonomy_redirect. Not sure why installing taxonomy_redirect makes a difference, but it does…to reproduce, do the following:
Using {} around the variable as suggested does not resolve the problem, even though it should (believe me, it was the first thing I tried). The only available resolution appears to be to assign the value of $term->weight to a separate variable prior to string interpolation, as in the patch.
As requested, I have updated the patch to reflect the latest dev version of tagadelic.
Comment #8
dawansv commentedI confirm similar problem here, also fixed by the patch.
I say similar because the symptoms are a bit different than described by the original poster. For one, all tags seem to be affected when taxonomy redirect is active, not just redirected vocabularies. Some vocabularies revert to 0 on all tags but not all. Other vocabularies get wrong, seemingly random levels assigned.
Here is an example (before patch applied of course) to show the erroneous levels:
Series without taxonomy_redirect module (turned off)-- CORRECT levels:
Same series with taxonomy_redirect module turned on -- WRONG seemingly random levels:
Comment #9
halfiranian commentedlegends. thanks for this patch!
Comment #10
doublejosh commentedThanks, this thread also showed me how to properly create a link to a term page so that taxonomy redirect can do it's job when I'm manually printing links.
Comment #11
foxtrotcharlie commentedTested, and it sorts out the issue for me.
Comment #12
xenoterracide commentedI don't see any cc option so... just CC-ing myself.
Comment #13
sjf commentedPatch works for me. Thanks.
Comment #14
Bèr Kessels commentedcommitted to github. Will appear in next release.
Comment #16
elyobo commentedFYI, I submitted this as a bug to taxonomy_redirect before coming across this - http://drupal.org/node/620136 - I'll leave it open, as I still think that taxonomy_redirect shouldn't be messing with the values in the first place.
Comment #17
agileware commentedFYI,
#620136: Breaks Tagadelic Weighting has now been fixed in taxonomy_redirect also
Comment #18
hedac commentedthank you. patch working with 1.40.2.10 too
but.. should I patch also taxonomy redirect?
Comment #19
mstrelan commented+1
Comment #20
stg11 commented#7 patch works please put in next release. thanks
Comment #21
devkinetic commentedI bumped into this issue today and can confirm the patch in #7 works as intended.
I will also note that this was approved by the community, marked as fixed, and indicated that the patch was implemented into the branch back in 2009. I tried 1.3, 1.4-rc1, & 1.x-dev as of 9/13/12 and this patch has still not been implemented. I'm sure this was an oversight, and hope my gentle nudge will help out others running into this.
Comment #22
Bèr Kessels commentedIt was committed: https://github.com/berkes/tagadelic/blob/6.x-1.x/tagadelic.module#L395
The 7.x-branch does not contain this, but that is not released anyway (aka: it needs work still).