wired: Views Flashvideo field outputs duplicates for each video node
mirrie - October 17, 2009 - 13:58
| Project: | FlashVideo |
| Version: | 6.x-1.5-rc1 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
| Issue tags: | flashvideo views multiple thumbs |
Jump to:
Description
I do not know whether this is a "Views" issue or a Flashvideo issue but I get duplicate entries using the flashvideo field in Views all pointing to the same unique node. I do not have this issue with other content types. Any ideas how to troubleshoot this further?

#1
just noticed that the number of duplicates corresponds to the number of attachments that can be made for each node. If there is a jpg thumb and the original .avi and the .flv three videos get displayed, if there are only the jpg plus the .flv = two videos show up.
#2
anyone?
By the way, it used to work fine when I set it up. In the meanwhile I ran some updates of modules and a minor drupal update. I cannot pinpoint when exactly this problem occured since I am not checking this particular page regularly.
#3
I am getting the same exact problem. The problem seems to be the the flashvideo table does not get joined correctly with the node table. There are multiple entries in the flashvideo table for each node (thumb, flash, and original video I imagine). And since there is no join being created to limit the join with the flashvideo table, three entries are being returned by the query, and thus 3 thumbs. (See the email I sent to Flashvideo guys below)
One temporary solution is to turn on the distinct setting in your view. This worked for me. It does not fix the underlying problem though.
Module maintainers: any ideas on this?
======= EMAIL SENT =======
For some reason, I have 3 records in the FLASHVIDEO table for each video
node in the NODE table, and this is causing my views block to have 3 thumbs
for each video.
With this query:
select nid, type, title from node where type = 'video'
I get:
1, 'video', 'Gas Passer'
2, 'video', 'George'
3, 'video', 'Dance Like a White Guy'
4, 'video', 'How Long Can You Hold Your Breath'
5, 'video', 'Larry at Home Depot'
And the duplicates:
select fid, nid, oid from flashvideo
1, 1, 1
2, 1, 1
4, 1, 1
5, 2, 5
6, 2, 5
7, 2, 5
8, 3, 8
9, 3, 8
10, 3, 8
11, 4, 11
12, 4, 11
13, 4, 11
14, 5, 14
15, 5, 14
16, 5, 14
Here is the query that the Views module created:
SELECT
node.nid AS nid,
flashvideo.nid AS flashvideo_nid,
node.title AS node_title,
node.created AS node_created
FROM
node node
LEFT JOIN flashvideo flashvideo ON node.nid = flashvideo.nid
WHERE
node.type in ('video')
ORDER BY
node_created DESC
Am I doing something wrong? I have FlashVideo 6.x-1.5-rc1 and Views
6.x-2.5.
#4
Hi,
Views module is hit by a bug in db_rewrite_sql
Can you please check if this patch resolve your problem ?
http://drupal.org/node/501552#comment-2059450
#5
Thanks for the response. That does not sound like the issue we are having though. That issue seems to be, if I understand right, that DISTINCT gets applied incorrectly.
In this case, if you make Views use DISTINCT, DISTINCT is applied correctly and our issue goes away. But this is not the correct solution. After examining the query generated by Views, the tables involved, and the Flashvideo Views code, it seems that an incorrect join is happening and that another table is supposed to joined that is not.
I have filed an official bug report on this for Flashvideo:
http://drupal.org/node/635858
#6
Yes, the current fix for this display issue is to use "DISTINCT" within your view.