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

chasz - September 3, 2008 - 04:48

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

NancyDru - September 11, 2008 - 10:14
Status:active» postponed (maintainer needs more info)

I'm sorry, I don't understand what you're asking here.

#3

NancyDru - October 1, 2008 - 15:11

Apparently this is a problem with Views1 as well: #312655: adding taxonomy_image field in views - create multiple listing .

#4

chasz - October 2, 2008 - 04:39

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

NancyDru - October 3, 2008 - 01:04

This modules doesn't ask Views to do anything; this module provides data when Views requests it.

#6

NeoID - October 12, 2008 - 16:18

#7

NeoID - October 13, 2008 - 19:10

@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

aurelien-bordeaux - November 11, 2008 - 12:35

suscribing.

#9

NancyDru - November 11, 2008 - 19:32
Priority:critical» normal

Well, I guess we need a Views expert - and that is not me.

#10

krunar - November 15, 2008 - 14:06

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

NancyDru - November 15, 2008 - 15:57

That patch has been applied. But it is not for Views2. I have asked a Views expert to check all these issues.

#12

krunar - November 16, 2008 - 13:15

sorry wrong post.

#13

NeoID - December 5, 2008 - 10:11

Still no solution?
This is a critical bug...

#14

NeoID - December 5, 2008 - 10:11
Priority:normal» critical

#15

chasz - December 26, 2008 - 13:32
Title:Duplicates with View2» Recursive display of entry for every taximage with View2 (duplication)

so is it duplicates or is it just recursively displaying to views2 the original entry and then an entry for every taxonomy image?

#16

chasz - December 26, 2008 - 13:40
Title:Recursive display of entry for every taximage with View2 (duplication)» Recursive (Multiple) displays of same entry for every taximage with View2

try that title :P

#17

NancyDru - December 30, 2008 - 07:49
Priority:critical» normal

I understand the issue, but I cannot duplicate it.

#18

chasz - December 30, 2008 - 14:23

how can u not duplicate it?? can you take a screenshot of the settings for the view and the preview shot?

#19

NancyDru - December 30, 2008 - 15:30

Here they are.

AttachmentSize
taxo_img_view_2.jpg 36.35 KB
taxo_img_view_1.jpg 70.15 KB

#20

chasz - December 30, 2008 - 16:19

hmmm, thanks, now can u put the taximage first in the display. wanna test something LOL

#21

NancyDru - December 30, 2008 - 21:18

OK

AttachmentSize
taxo_img_view_3.jpg 35.38 KB

#22

chasz - December 30, 2008 - 21:48

wait a minute? how many tax terms do u have per node listed there?

#23

NancyDru - December 31, 2008 - 00:42

All of those only have one.

#24

NancyDru - December 31, 2008 - 00:49

Ah, I added another term to one of the nodes and it did produce a duplicate. BTW, Views warns that this would happen.

Taxonomy terms. Note that using this can cause duplicate nodes to appear in views; you must add filters to reduce the result set.

#25

bigheadfish - February 2, 2009 - 07:11

I did not get such warning msg.

#26

bigheadfish - February 2, 2009 - 08:10

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

NancyDru - February 2, 2009 - 15:29

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

chasz - March 17, 2009 - 11:41

no solution yet ?? :D

#29

NancyDru - March 17, 2009 - 13:42
Title:Recursive (Multiple) displays of same entry for every taximage with View2» Multiple displays of same entry for every taximage with View2

As I said, I am not Views guru. Every time I've tried to work on this, I break Views.

#30

xamount - April 8, 2009 - 00:59

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

NancyDru - April 8, 2009 - 13:46

Its just one of those weird cases where things don't work because it was not designed to do so.

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.

#33

mr.andrey - April 20, 2009 - 03:36

subscribing...

#34

najibx - April 20, 2009 - 12:42

was wondering what's going on until i found this thread ....
subscribing.

#35

najibx - April 20, 2009 - 13:10

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

najibx - April 20, 2009 - 13:43

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

mr.andrey - April 20, 2009 - 17:02

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

najibx - April 20, 2009 - 17:24

Taxonomy: Vocabulary under filters does the job. Learning more on views now ... TQ

#39

castawaybcn - May 15, 2009 - 12: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.

AttachmentSize
view-01_without_TI.png 1.24 KB
view-02_with_TI.png 4.46 KB

#40

luco - July 23, 2009 - 20:36

thanks @mr.andrey, that solved for me :D

cheers

#41

bzzz - August 26, 2009 - 08:59

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

vitkinet - November 19, 2009 - 02:45

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

 
 

Drupal is a registered trademark of Dries Buytaert.