Multiple displays of same entry for every taximage with View2
chasz - August 30, 2008 - 20:21
| Project: | Taxonomy Image |
| Version: | 6.x-1.x-dev |
| Component: | Views |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Description
Sorry about this LOL
but i seem to have duplicates one with the image and one without. i checked the edit and delete links and both have the same nodeid

#1
when i added the taximage as a field for views.module...is there a restriction i need to stop views from adding a second entry/row with the image in addition to the one without the images?
#2
I'm sorry, I don't understand what you're asking here.
#3
Apparently this is a problem with Views1 as well: #312655: adding taxonomy_image field in views - create multiple listing .
#4
so where is the error coming from? views.module or this one?
its seems that i only have duplicates and not an entry for each taximage: i had an image for news and newsfeeds, same image so i didnt check whether i was getting multiple listings
Views would not have multiple listing unless this module is asking it to do some recursive checking
#5
This modules doesn't ask Views to do anything; this module provides data when Views requests it.
#6
I have the same problem...
http://img374.imageshack.us/img374/1861/64669731hy9.jpg
#7
@chasz:
I think the error comes from this module since Views displays nothing wrong regardless of what terms I add without this module enabled.
My best bet is that the problem is somewhere in the function that sends data back to Views, but I'm not really sure.
Since my website depends on this module and I want to use it for a some other sites it's critical to get this one to work.
I'll try to look into the module and see if I find anything useful, hopefully we can find a solution...
Image: http://img89.imageshack.us/img89/3871/39318712mi6.jpg
#8
suscribing.
#9
Well, I guess we need a Views expert - and that is not me.
#10
subscribing
From what i understand there is a patch correcting this for 5.x. here http://drupal.org/node/312655
Maybe someone that understand this better than me can help
#11
That patch has been applied. But it is not for Views2. I have asked a Views expert to check all these issues.
#12
sorry wrong post.
#13
Still no solution?
This is a critical bug...
#14
#15
so is it duplicates or is it just recursively displaying to views2 the original entry and then an entry for every taxonomy image?
#16
try that title :P
#17
I understand the issue, but I cannot duplicate it.
#18
how can u not duplicate it?? can you take a screenshot of the settings for the view and the preview shot?
#19
Here they are.
#20
hmmm, thanks, now can u put the taximage first in the display. wanna test something LOL
#21
OK
#22
wait a minute? how many tax terms do u have per node listed there?
#23
All of those only have one.
#24
Ah, I added another term to one of the nodes and it did produce a duplicate. BTW, Views warns that this would happen.
#25
I did not get such warning msg.
#26
From the perspective of SQL, to get rid of the duplicate display without taximage, we need to say term_image.tid !=NULL or term_image.tid >0
But I have no idea on how to modify the SQL backing View.
#27
That's not a message that shows up at the top of the page. It shows up in the definition area and is not highlighted.
I have no idea how to modify Views -- I can barely even use it.
#28
no solution yet ?? :D
#29
As I said, I am not Views guru. Every time I've tried to work on this, I break Views.
#30
I think I have an idea of whats going on here.
If you are trying to list taxonomy images by using a view:
1. You would have selected Taxonomy Image: Image as the View field
2. Probably set the filter: Taxonomy: Terms for your_term
You would expect that the result set would return distinct taxnomy images.
But seeing as the View is run against the nodes table (when it should probably run against the term tables), the view pulls a LISTING OF NODES with terms tagged with your_term.
Therefore, you would be displaying the taxonomy image for each node found and if you have a more than one node with the same taxonomy term, you get duplicates.
This is not the fault of the Views module (as the module does what is supposed to do) and I do not think the taxonomy image module is entirely at fault. Its just one of those weird cases where things don't work because it was not designed to do so.
What should probably happen is that the Views query be run against the taxonomy tables and pulls distinctly the image attach to each taxonomy term (if the image exists).
I do not know the solution but I know a few work arounds.
Work around Option 1
Create a nodequeue and for each taxonomy image that you want appear, add a node tagged with the respective term to the queue. Then create a view that lists the taxonomy images from nodes in this queue. As long as you don't add 2 nodes with the same term, you would not get duplicates.
Work around Option 2
Create a block with php input format setting and manually call taxonomy_image_display(..) for each image you want to display.
Admittedly, both workarounds suck, but if you really need this functionality (as I do), you can try it.
#31
I don't even know that doing the query against the terms table will fix this. There is a many-to-one relationship involved between nodes and terms; and a one-to-many relationship between terms and nodes. This situation is going to always produce results that are not optimal.
If anyone knows a Views coding guru, perhaps they can make this situation better, but I doubt that it can be totally cured for all cases.
#32
Marked #437204: I'm getting doubles in Views of each node that has an icon associated with it. as duplicate.
#33
subscribing...
#34
was wondering what's going on until i found this thread ....
subscribing.
#35
BTW, if I were to use "Taxonomy terms. Note that using this can cause duplicate nodes to appear in views; you must add filters to reduce the result set." i'm still getting the duplicated. a step back .... how shall I use this if a node belongs to multiple terms in different vocabularies. I think this relevant because the symptom is the same..... view's issue rather?
#36
as for #35, to reduce duplicate, one should use "Taxonomy: All terms" then should check "Limit terms by vocabulary" ..in which you can select which one to show. It's hidden there huhu ..... I found this from http://drupal.org/node/345571#comment-1188223
unless "Taxonomy Image" can provide similar function beside only " Taxonomy: Term image The image associated with a taxonomy term." I guess we are out of luck, as nothing Views can do about it.
#37
In my case, all of the posts are categorized by one required vocabulary: post type, but only two of three terms have an icon. If I set Taxonomy: Vocabulary = Post type under filters, the duplicates disappear.
Best,
Andrey.
#38
Taxonomy: Vocabulary under filters does the job. Learning more on views now ... TQ
#39
not in my case at least, see attached screenshots :(
this is the query for the first one (no taxonomy image field)
SELECT DISTINCT(node.nid) AS nid,node.title AS node_title,
node.type AS node_type,
node.vid AS node_vid
FROM drup_node node
LEFT JOIN drup_content_field_sistema node_data_field_sistema ON node.vid = node_data_field_sistema.vid
LEFT JOIN drup_term_data term_data_node_data_field_sistema ON node_data_field_sistema.field_sistema_value = term_data_node_data_field_sistema.tid
WHERE term_data_node_data_field_sistema.vid in ('3')
and for the second one (with taxonomy image field)
SELECT DISTINCT(node.nid) AS nid,node.title AS node_title,
node.type AS node_type,
node.vid AS node_vid,
term_image.tid AS term_image_tid
FROM drup_node node
LEFT JOIN drup_content_field_sistema node_data_field_sistema ON node.vid = node_data_field_sistema.vid
LEFT JOIN drup_term_data term_data_node_data_field_sistema ON node_data_field_sistema.field_sistema_value = term_data_node_data_field_sistema.tid
LEFT JOIN drup_term_node term_node ON node.vid = term_node.vid
LEFT JOIN drup_term_image term_image ON term_node.tid = term_image.tid
WHERE term_data_node_data_field_sistema.vid in ('3')
I believe this has something to do with not being able to group multiple values in the Taxonomy Image field options.
#40
thanks @mr.andrey, that solved for me :D
cheers
#41
As I understand it's not a bug, right?
So anyone know how to create field type "All terms images"? Or might be it already created?
I mean this field must be like "All terms", but as images.
#42
I developed a patch for this module, which allows to display all term images for a given node as a single view field without generating duplicate rows. Tested with drupal-6.14 and taxonomy_image-6.x-1.6. See it here: http://drupal.org/node/471530#comment-2282102