At first I had trouble with uploading but the dev version fixed that quite nicely!

So I can upload images to the terms now but nothing displays when viewing the term-page .. or a node page with the term attached .. or any view with the taxonomy_image field, views displays nothing at all not even text/link.

The only place I can see the image is when viewing a taxonomy term's edit page.
At first I was using image cache then without it, both give same result.

Is there a special cck field that taxonomy_image requires?
I also tried deleting the cck taxonomy field and using the default taxonomy node form, no luck. Nothing works! lol
Access taxonomy images is enabled for all roles.

I have cleared cache in between changes and dbUpdates.... Still nothing. =(
Anyone else have similar issue?

Comments

Macronomicus’s picture

Title: No image displayed - CCK taxonomy field with Views » No image displayed - CCK taxonomy field
Version: 6.x-1.6 » 6.x-1.x-dev
Component: Views » Miscellaneous
Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

cleaning...

Macronomicus’s picture

Status: Closed (fixed) » Active

cleaning...

Macronomicus’s picture

I also just noticed that taxonomy_images will not display on views that use fields. So im having to use the teaser or body row style with grid or unformated Style. Is that intentional? I guess its ok I can just theme the output.

j0rd’s picture

Title: No image displayed - CCK taxonomy field » No image displayed - CCK taxonomy field with Views
Version: 6.x-1.x-dev » 6.x-1.6
Component: Miscellaneous » Views
Category: support » bug
Priority: Normal » Critical

This is a bug which has come from the most recent update. I've just updated and now my page with views which use taxonomy image's in fields, do not show up.

Something got messed up.

To test, create some taxonomy terms with images. Create a view of "type: term". Set "Row Style: fields", add fields "Taxonomy: Term and Taxonomy: Term image", then see if your Term Images show up below the term names.

For me this broke after updating from 1.15 to 1.16.

Macronomicus’s picture

Title: No image displayed - CCK taxonomy field » Taxonomy images will not display on views that use fields
Version: 6.x-1.x-dev » 6.x-1.6
Component: Miscellaneous » Views
Category: support » bug
Priority: Normal » Critical

Yep we've got ourselves a bug. I just verified that this is not present in in the 6.x-1.5 iteration.

j0rd’s picture

I removed most of the changes which were made in 1.6 back to 1.5 and I got it working again. The code in question here seems a little round about to me and the author tried to simplify it in 1.6, but ended up getting the paths wrong.

I believe the author has minimal views experience, so it should be up to us to provide a solution for him/her.

I'd provide mine, but I just checked the page which I made my fix for and it's broken again :D...so I'll have to look into it again, unless someone else provides a solution.

If you need this to work in the mean time, reverting back to 1.5 should resolve your problem I believe.

Macronomicus’s picture

Very cool ... I wonder what other fixes were rolled into the 1.6 ... @ least going back to 1.5 is easy enough but sort of messes up my workflow as I use drush from the command line to perform updates (much faster) I'll just have to do each module individually until we get 1.6 removed or fixed.

Thanks for taking a look at it and posting back.
^_^

nancydru’s picture

You are right, I am not a Views guru, so your help would be appreciated. It would be nice to have a Views maintainer on the project.

As for what changes were included, check the Release Notes.

aschiwi’s picture

What happens to me is that in a view of one content type only one entry of 10 shows the taxonomy image when I add "distinct: yes" to the view. If I don't add the distinct part, I get all duplicates in the view, one with taxonomy image, one without. In the same view, but another instance (another block) I get taxonomy images for all entries. Unfortunately I'm no good at debugging or reading complicated code like this, so all I can do is report this :(

manoz_79’s picture

Was this problem sorted out? I am still unable to display term images in my views which has fields. Help would be greatly appreciated.

Thanks,
Manoj

fletch11’s picture

I was having trouble configuring this at first but it appears to be working with the latest version after I configured with XX-1.5 and then upgraded to the .dev release. If you are using a tpl.php file to theme your view note that you should call the field using

print $fields['tid']->content;

However, if you're looking to call it in a node you still need to use this in a node.tpl.php file:

  if ($taxonomy) {
    $output = NULL;
    foreach ($node->taxonomy as $term) {
      if ($image = taxonomy_image_display($term->tid)) { 
        $output .= "$image";
      }
    }
    echo $output; 
  }
;
jziwenchen’s picture

hi.
i use the 6.x-1.x-dev Taxonomy_Image.
Edit taxonomy_image.module , go to 244 lines [or near this line],
you will find code likes this:
$image[$tid]->url = file_create_url($mylpath . $image[$tid]->path);
modify it to :$image[$tid]->url = file_create_url($fullpath . $image[$tid]->path);

and go to 262 lines (or near this line),
you will find code likes this:
$image[$tid]->url = url($fullpath . $image[$tid]->path);
modify it to $image[$tid]->url = file_create_url($fullpath . $image[$tid]->path);

It's ok in my site.
Hope it can help you !

snufkin’s picture

Status: Active » Needs review
StatusFileSize
new784 bytes

I found that there is an issue with the views handler when using fields. Now i am not an expert in views, but dumping the variables in question i found that the patch here fixes it. I made this change so that it should fall back to the old tid lookup, so should not make things worse.

carvalhar’s picture

Status: Needs review » Active

Hi,

I got the same problem...

i had to do load the node again to load back the tid:

function render($values) {
    $image = '';
    $tid = $values->{$this->field_alias};
	if (!$tid ){
		//check the vocabulary
		$termfromnode = node_load($values->nid);
		$termNode= taxonomy_node_get_terms_by_vocabulary($termfromnode, 2);
		foreach ($termNodeas $term) {
			$tid = $term->tid;
		} 
	}
    if (!$tid) {
      return;
    }

The problem is tid isn't being passed to views_handler_field_taxonomy_image.inc

snufkin’s picture

did the patch not work for you?

carvalhar’s picture

nops! neither...

marascos’s picture

same issue here.

vosechu’s picture

Can you tell me whether your images render if you render the view twice in one page? If you add this to your page.tpl.php you can render twice. I'm having an issue where on one of my servers it renders great with fields but on the other when using fields it only renders if the view has already been rendered once before. Caching doesn't even matter.

print views_embed_view('category_panels', 'panel_pane_1');
print views_embed_view('category_panels', 'panel_pane_1');
print views_embed_view('category_panels', 'panel_pane_1');

Naturally, replace with your view->name and view->current_display instead of category_panels and panel_pane_1

vosechu’s picture

Can you try this patch and find out if it works for you?

http://drupal.org/node/998600

topdillon’s picture

I applied jackeychan's changes from #12 to dev version. Still no images. If I am not mistaken, this is identical to the patch.

marascos’s picture

I applied this patch but still have the same issue. I am only displaying the view once on a page.

crasher’s picture

Status: Active » Closed (fixed)
topdillon’s picture

Could you provide some info? How is this fixed? I don't see a fix anywhere.

topdillon’s picture

Okay. I got it working.

One oddity. I have a filter for termID with depth. If I use the filter for termID but NOT with depth, the image does not show.

jenlampton’s picture

I am using version 6.x-1.6. I have a term view, with row-style set to fields, and the "Taxonomy image" field added. The images do not display.

There are no filter options for "Taxonomy term ID with depth" the only filter available for term id is "Taxonomy term ID".

If I figure this out I'll try to leave some documentation for the next person :)

jenlampton’s picture

Version: 6.x-1.6 » 6.x-1.x-dev
Status: Closed (fixed) » Active

Upgraded to the -dev version and still no images will display. Re-opening this issue since it's not resolved.

jenlampton’s picture

Status: Active » Needs review
StatusFileSize
new9.98 KB

Okay, I found a problem in the module with how the IMG tags were being built. I replaced the custom HTML assembly with a call to theme_image and things started working again. This will probably need some rethinking for imagecache presets to work correctly, but here's my first stab at it.

ericaordinary’s picture

Just a note on this, I've found the images work when an imagecache preset is applied to your taxonomy image field in views. The image path seems to be built incorrectly for images set as default, as it's looking for the image inside the imagecache directory, except I don't think these default images will have been processed by imagecache. Not a solution, but at least a workaround to get the images to display.

capellic’s picture

Status: Needs review » Reviewed & tested by the community

Works great! Please get the patch in #27 applied to DEV and let's get another proper release done.

Niklas Fiekas’s picture

Thanks @jenlampton!

There are lots of coding style and unrelated(?) changes in the patch, which makes committing it without feedback from @NancyDru a bit scary. Most (if not all) of the coding style changes are good though -- just saying seperate patches would be easier to review.

Other than that I just noticed some trailing whitespace, while skimming it.

nancydru’s picture

Some things I see in a quick perusal:

  1. Even if they are commented, please remove debugging statements.
  2. I see an "elseif" changed to "else if". IIRC, Drupal coding standards call for "elseif". Personally I avoid the controversy by splitting the "if" to a separate line; IMHO this is more readable anyway.
  3. There is some evidence that function calls in a WHILE are slower that performing it outside the loop. "while ($parent = db_fetch_object(db_query('..."
  4. Trailing whitespace.

As Niklas says, and even though I have been guilty as well, I'd rather see style changes separated into a different patch.

Niklas, Jen knows what she's doing. But your hesitation is commendable.

nehajyoti’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

6.x version is outdated. Hence closing the issue!