the taxonomy images displayed in nodes have wrong links to the corresponding taxonomy term, infect the have all the same link to a non-existing term.

any idea what i can do about it?

Comments

e_log’s picture

furthermore the term all the taxonomy images links to, change every on page load.

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

I don't see anything like this. I wonder if some other module is interfering. If this was widespread, there would be tons if issues filed.

jsg’s picture

Status: Postponed (maintainer needs more info) » Active

I have a similar problem. I have a vocabulary Geography, within which are regions and countries. The countries have small flag images attached using Taxonomy Image. The flags display appropriately. But they are linked to a non-existent address. Example: http://www.[...].org/files/category_pictures/Australia.jpg - this gives a 404 if clicked.

It would be more appropriate if they linked to the relevant taxonomy term.

BTW this is in 5.x-1.4.

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

I am not seeing this; can you, please, give me some more details on how this is set up so that I can try to find the cause?

jsg’s picture

Setup as requested:

Drupal 5.7; Taxonomy Image 5.x-1.4; no other Taxonomy Image modules enabled. Other optional modules, including Taxonomy Browser and Taxonomy Hide. Picture image path: files/category_pictures; User "Disable" box description: (default); Link title: Term description; Resizing Options: Constraint: Disabled; height and width both blank; Advanced: Add wrapper div tag [no]; Recursive image display: Disabled. All users have the "access taxonomy images" permission and no others (only user 1) have the other permissions.

Nine vocabularies, of which seven are active and four have images attached to some or all terms. But for a Story or a Page, only three vocabularies are active, although all three have images attached to some or all terms. The problem described in #3 applies to all taxonomy images in all vocabularies.

Many thanks for the response. I'm not exactly sure which setup elements are relevant, so if I've missed something, please ask. Jeremy

e_log’s picture

did some test after you suggested the interference with a nother module.

all taxonomy images link in fact to taxonomy/term not taxonomy/term/n

the number at the end was created by autopath and the changes where caused by autopath changing the alias (who knows why....)

So the proper description of the problem is, that the images link to taxonomy/term and not a specific term.

jsg’s picture

Thank you for the follow-up and testing. However, in my installation the images do not link to /taxonomy/term but instead they link to (for example) /files/category_pictures/Australia.jpg. BTW I don't have autopath activated (yet).

nancydru’s picture

Okay, both of you list 1.4 as the release rather than the -dev versions. There were some link fixes in -dev. I rolled 1.5 releases this morning. Please try that and let me know if these things are fixed.

jsg’s picture

Thank you very much for doing that. I'm sorry to report that there is no change here after the upgrade to 5.x-1.5. Jeremy

e_log’s picture

thanks NancyDru, my problem is solved with the new release! perfect!

@jsg
your problem seams to be somhow different then mine......

but i remember i had problems when using taxonomy hide and taxonomy image at the same time. u probably want to try with taxonomy hide disabled.

btw, have u checked:
Link displayed Taxonomy Image to taxonomy/term/n page
Home › Administer › Site configuration › Taxonomy Image › Node Display?

nancydru’s picture

Version: 6.x-1.4 » 5.x-1.5

Well, that's 50%

@jsg: Can you verify that somehow that image hasn't been deleted, renamed, or moved?

jsg’s picture

@NancyDru:

Image is in /modules/image. Upgraded last week to 5.x-1.9. Image Gallery and ImageMagick Advanced Options are also activated. Imagemagick itself was added last week.

Default image path is "files/pictures" -- until last week, this had a trailing slash, which was causing repeated attempts to generate derivative images.

@e_log:

I tried disabling Taxonomy Hide, but this did not change the links.

I don't seem to have the option Link displayed Taxonomy Image to taxonomy/term/n page (Home › Administer › Site configuration › Taxonomy Image › Node Display).

Thanks again.

Leeteq’s picture

See also this issue:
http://drupal.org/node/339822

- which also mention that the images link to taxonomy/term without a term number appended.

nancydru’s picture

Yes, and in both cases, I cannot recreate the problem. I need your help to try to figure out what's going on.

jsg’s picture

I'm keen to help. Can you suggest some testing that I could do to help?

nancydru’s picture

@jsg: Remember that TI caches term images (and paths), so you need to clear the TI cache often when testing.

jsg’s picture

I'm not sure whether I have done the right thing to clear the TI cache -- can't see it in the documentation :( -- so I have tried truncating (table) cache_tax_image on my system.

Unfortunately I still have the problem: e.g. a page in category "United Kingdom" shows a text link to http://mysite.org/taxonomy/term/103, but the UK flag image (for that term) links to http://mysite.org/files/category_pictures/%20United%20Kingdom.jpg

Thank you very much for sticking with this.

nancydru’s picture

Is it possible to see this in action? You can use my contact page if you want to do it privately.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed

It looks like you should have selected the "Node Display" component. And it looks like all you want is to turn on the "Link displayed Taxonomy Image to taxonomy/term/n page" setting to change the link to go to the "taxonomy/term/nn" page.

jsg’s picture

Thanks for the response. I tried this on my test site and although it caused no problems, I still had the same issue. This comment is a bit long, but it explains the convoluted process that I followed in finding a workaround.

I eventually remembered to run TRUNCATE `cache_tax_image`and for good measure I cleared my browser cache, but this didn't help.

For completeness, in /admin/settings/taxonomy_image, under Node Display, I have:

Display taxonomy images on tagged nodes: Page, Story
Show Taxonomy Image in node teaser view [checked]
Show Taxonomy Image in node page view [checked]
Link displayed Taxonomy Image to taxonomy/term/n page [checked]
Display weight of taxonomy images: -5 [default]

The last item was slightly puzzling because the images were still displaying floated right. So I wondered whether I need to do something further in my theme.

The "aha!" moment was when I looked at template.php. This included:

<?php
function _phptemplate_variables($hook, $vars) {
  if ($hook == 'node' && module_exists("taxonomy_image")) {
    foreach (taxonomy_node_get_terms($vars['node']->nid) as $term) {
      if ($img = taxonomy_image_display($term->tid, "title='$term->description'")) {
        $vars['taxonomy_images'][] = "<a href='files/category_pictures/$term->name.jpg'>" . $img . '</a>';
      }
    }
  }
  return $vars;
}
?>

Presumably this dated back to a previous version of TI. But obviously this is where the dodgy links come from. So my next step was to comment this out. The TIs disappeared. So why are the Node Display TIs not displaying?

So now I checked out the past edits in my theme, a variant of bluemarine. It was not clear to me how to do this. There was nothing in page.tpl.php or box.tpl.php. But in node.tpl.php, there was this:

<?php 
  if ($taxonomy_images) { 
    foreach ($taxonomy_images as $image) {
      ?> 
      <div class="taxonomy-image"> 
        <?php 
        print $image;
        ?> 
      </div> 
      <?php 
    } 
  } 
?>

I tried commenting this out too. I TRUNCATEd cache_tax_image again. No TIs visible.

For now, I have un-commented both code chunks and I have edited the first one to correct the link:

<?php
        $vars['taxonomy_images'][] = "<a href='/taxonomy/term/$term->tid'>" . $img . '</a>';
?>

...and I have deactivated Node Display. This seems an inelegant workaround, but it works.

One final thought. I just re-read TI's documentation and I could not at first see where it tells you to activate Node Display. (Actually it's at item 7 in INSTALL.) Maybe this needs a minor update, if only to increase emphasis on the handbook pages? And maybe it would be worth mentioning to upgraders that Node Display will (or at least is intended to) supersede hand-coded theme modifications?

Nancy, thank you very much for your persistence with this. If you can see what I'm missing, I'd be very grateful.

nancydru’s picture

I run my sites with absolutely no theme changes and it all works as it was designed. And my main 5.x test site runs Bluemarine, as does my Drupal documentation/demo site.

I have updated several of the doc pages and will update the Install text.

jsg’s picture

I should have tried that. But now I have. In a standard unmodified theme (Bluemarine), with 5.15 and all the latest contrib modules, and Node Display switched on, I still don't see the TIs. (This is after TRUNCATEing cache_tax_image and clearing the browser cache.) So my next thought was that this might be a conflict with some other module.

Found it! Contrib module Taxonomy Hide was the problem. Somehow it suppresses all the TIs that Node Display is trying to display (not just the ones that TH has been told to hide). Unfortunately I need TH, so I have gone back to my kludge-in-the-theme solution. I guess the conflict might be worth documenting, assuming that a fix is too hard.

Thanks again for your help with this.

nancydru’s picture

Okay, please open a new feature request to work with TH and I'll try to look at it (but no promises because it sounds like TH is doing what it is supposed to do).

nancydru’s picture

Oh, try this: Go into the system table and set the TH weight up higher than TI. Maybe if TI gets there first it will work.

jsg’s picture

Status: Active » Fixed

I set TH's weight to 1 and Node Display worked. Thank you! Could I suggest adding this to the docs?

For completeness, in case anybody is following this issue in detail, here are some notes on the other things I did to complete the removal of the theme kludge:

  • removed the kludge code in mytheme/template.php and mytheme/node.tpl.php
  • updated TI to 5.x-1.x-dev to get the option to remove display of the term name (issue #353555)
  • added
    a.taxonomy_image_links img {
      float: right;
    }

    to mytheme/style.css (your issue #285021)

  • puzzled over why this was not working
  • eventually worked out that I had /admin/settings/performance Aggregate and compress CSS files: Enabled
  • had to turn this on and off a couple of times, but eventually it worked.

Nancy, thanks again for exceptional support.

Leeteq’s picture

Status: Fixed » Active
nancydru’s picture

@Daniel: It would appear to be fixed; why did you set it active?

nancydru’s picture

Leeteq’s picture

@Nancy/#27: I was tired I guess. I assumed the adjustment of weight was something that suggested another code update, but obviously in the TH module, not here...

nancydru’s picture

Status: Fixed » Closed (fixed)

Clearing the issue queue.