Getting the lot of duplicates in views result after updating the views from 7.x-3.15 to 7.x-3.17. Reverting the views to previous version (7.x-3.15) fixes the issue but since 7.x-3.17 version is security update so therefore its not feasible to revert it back and hence marking the priority as Major.

On debugging found that the problem is coming only for those views which are having the filter of content translation (Content translation: Select translation).

Difference between the views query is as following:

Query of views with 7.x-3.15 version:

SELECT node.created AS node_created, node.nid AS nid, 'homepage:page_1' AS view_name
FROM 
{node} node
INNER JOIN {flagging} flagging_node ON node.nid = flagging_node.entity_id AND flagging_node.fid = '1'
LEFT JOIN (SELECT nt0.nid AS nid, nt0.tnid AS tnid, nt0.status AS status, nt0.language AS language
FROM 
{node} nt0
WHERE  (nt0.language = 'en') ) nt0 ON node.tnid = nt0.tnid AND (node.tnid != 0)
WHERE (( (node.status = '1') AND (node.type IN  ('event', 'news')) AND( (node.tnid = '0') OR( (node.language = 'en') )OR( (node.nid = node.tnid) AND (nt0.nid IS NULL) ))))
ORDER BY node_created DESC
LIMIT 12 OFFSET 0

Query of views with 7.x-3.17 version:

SELECT node.created AS node_created, node.nid AS nid, 'homepage:page_1' AS view_name
FROM 
{node} node
INNER JOIN {flagging} flagging_node ON node.nid = flagging_node.entity_id AND flagging_node.fid = '1'
LEFT JOIN (SELECT nt0.nid AS nid, nt0.tnid AS tnid, nt0.status AS status, nt0.language AS language
FROM 
{node} nt0
WHERE  (nt0.language = 'en') ) nt0 ON node.tnid = nt0.tnid
WHERE (( (node.status = '1') AND (node.type IN  ('event', 'news')) AND( (node.tnid = '0') OR( (node.language = 'en') )OR( (node.nid = node.tnid) AND (nt0.nid IS NULL) ))))
ORDER BY node_created DESC
LIMIT 12 OFFSET 0

On checking the difference of above queries on https://www.diffchecker.com/nHhh2OzI , found that the only difference between above queries is of one WHERE condition (" AND (node.tnid != 0)" is been removed in query of views 7.x-3.17 version).

CommentFileSizeAuthor
#3 2904065-3.patch7.41 KBankit agrawal

Comments

Ankit Agrawal created an issue. See original summary.

rajiv.singh’s picture

Hi @ankit,
the filter WHERE (nt0.language = 'en') ) was provided from module Select Translation using the latest version of it fixed the issue.

ankit agrawal’s picture

StatusFileSize
new7.41 KB

Thanks Rajiv. By the way I have also found the views module file (handlers.inc) which on reverting fixed the issue for me. Sharing the patch of same.

Cheers,
Ankit

ankit agrawal’s picture

Status: Active » Needs review
rajiv.singh’s picture

Hi @ankit,
that file has fixes for issue https://www.drupal.org/node/1090432 (and few other issues) in 7.x-3.17 , It seems you have reverted that file (handlers.inc) with two version old (7.x-3.15 )

Please do not revert latest changes , just because it worked for you , Test views project on vanilla installation or at http://simplytest.me to produce that issue and then introduce patch of issue is produced again . I found no problem with Views module but an additional module https://www.drupal.org/project/select_translation

damienmckenna’s picture

Status: Needs review » Postponed (maintainer needs more info)
Issue tags: -views, -duplicate

Please test out the new 3.18 release and let me know if the problem still exists.

mustanggb’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

angel franch’s picture

Title: Duplicate content after updating views from 7.x-3.15 to 7.x-3.17 » Duplicate content after updating views from 7.x-3.18 to 7.x-3.19
Version: 7.x-3.17 » 7.x-3.19
Priority: Major » Normal
Issue tags: +Regression

Getting a lot of duplicates in views result after updating from 7.x-3.18 to 7.x-3.19. Reverting to 7.x-3.18 fixes the issue.