Reproduce of an error:
1. Single node has a Content Taxonomy Field `field_OURFIELD` which is set to have multiple values, and eg. 3 values are putted into that field for that particular node. (from one taxonomy vocabulary)

2. Create a view and add field : Content Taxonomy Field: field_OURFIELD - select 'Group multiple values'.

3. Each node is repeated n-times where n is the number of different values putted to that field - 3 times for our node and each of cloned node has all 3 values listed.

So in fact displaying field itself is working OK, but grouping for the view is not. I'd like to see each node only once ;) regardless of number of values putted to content_taxonomy fields.

CommentFileSizeAuthor
#4 Duplicates.png26.62 KBcastawaybcn

Comments

castawaybcn’s picture

I know this is a rather old one, but I am having the same problem with 6.x-1.0-beta6
Did you find a solution?

castawaybcn’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta6
mh86’s picture

Status: Active » Postponed (maintainer needs more info)

I think this problem is caused by a wrong configuration of your view. I'm pretty sure, that the group multiple values feature is working with content taxonomy fields. Do you have the same problems with any other fields? And maybe you can provide some more configuration information.

castawaybcn’s picture

StatusFileSize
new26.62 KB

As far as I know it is just happening with content taxonomy fields, but it could perfectly be a misconfiguration of my view.
Since I am not exactly sure what configuration would be more useful I am sending you both a screenshot of the view with the duplicate elements and the query. If there is anything else I can provide let me know, I am rather new to Drupal.

SELECT node.nid AS nid,
   term_data.name AS term_data_name,
   term_data.vid AS term_data_vid,
   term_data.tid AS term_data_tid,
   node.title AS node_title,
   node_data_field_estat.field_prioritat_value AS node_data_field_estat_field_prioritat_value,
   node.type AS node_type,
   node.vid AS node_vid,
   term_data_node_data_field_prioritat__term_image.tid AS term_data_node_data_field_prioritat__term_image_tid,
   term_data_node_data_field_prioritat.weight AS term_data_node_data_field_prioritat_weight,
   term_data_node_data_field_prioritat.name AS term_data_node_data_field_prioritat_name,
   term_data_node_data_field_prioritat.vid AS term_data_node_data_field_prioritat_vid,
   term_data_node_data_field_prioritat.tid AS term_data_node_data_field_prioritat_tid,
   node_data_field_estat.field_estat_value AS node_data_field_estat_field_estat_value,
   term_data_node_data_field_estat__term_image.tid AS term_data_node_data_field_estat__term_image_tid,
   term_data_node_data_field_estat.name AS term_data_node_data_field_estat_name,
   term_data_node_data_field_estat.vid AS term_data_node_data_field_estat_vid,
   term_data_node_data_field_estat.tid AS term_data_node_data_field_estat_tid,
   term_data_node_data_field_assignat.name AS term_data_node_data_field_assignat_name,
   term_data_node_data_field_assignat.vid AS term_data_node_data_field_assignat_vid,
   term_data_node_data_field_assignat.tid AS term_data_node_data_field_assignat_tid,
   node.created AS node_created,
   node.changed AS node_changed
 FROM node node 
 LEFT JOIN content_field_assignat node_data_field_assignat ON node.vid = node_data_field_assignat.vid
 LEFT JOIN term_data term_data_node_data_field_assignat ON node_data_field_assignat.field_assignat_value = term_data_node_data_field_assignat.tid
 LEFT JOIN content_type_baca_tasques node_data_field_estat ON node.vid = node_data_field_estat.vid
 LEFT JOIN term_data term_data_node_data_field_estat ON node_data_field_estat.field_estat_value = term_data_node_data_field_estat.tid
 LEFT JOIN term_data term_data_node_data_field_prioritat ON node_data_field_estat.field_prioritat_value = term_data_node_data_field_prioritat.tid
 INNER JOIN term_node term_node ON node.vid = term_node.vid
 LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
 LEFT JOIN term_image term_data_node_data_field_prioritat__term_image ON term_data_node_data_field_prioritat.tid = term_data_node_data_field_prioritat__term_image.tid
 LEFT JOIN term_image term_data_node_data_field_estat__term_image ON term_data_node_data_field_estat.tid = term_data_node_data_field_estat__term_image.tid
 WHERE (term_node.tid IN (1, 9, 28)) AND (node.type in ('baca_tasques')) AND (node_data_field_estat.field_estat_value IN ('45', '46')) AND (node_data_field_assignat.field_assignat_value IN ('15', '27', '52', '55', '26', '25'))
   ORDER BY term_data_node_data_field_prioritat_weight ASC

As you will see in the screenshot I am trying to show a task list. Duplicate items happen whe more than one person (taxonomy field) is assigned to a task (node of a specific content type).

I hope this is helpful, and thanks for your interest in this issue.

mh86’s picture

try following: administer your view and set "Distinct" (in "Basic settings") to "Yes"

castawaybcn’s picture

I take it all back, it seems I cannot use it because of a misconfiguration in the database. And I truly know next to nothing about MySQL...

I understand this is completely off topic, but do you have any clues on what may be happening? Here's the error log:

    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), term_data.name AS term_data_name, term_data.vid AS ter' at line 1 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), term_data.name AS term_data_name, term_data.vid AS term_data_vid, term_data.tid AS term_data_tid, node.title AS node_title, node_data_field_estat.field_prioritat_value AS node_data_field_estat_field_prioritat_value, node.type AS node_type, node.vid AS node_vid, term_data_node_data_field_prioritat__term_image.tid AS term_data_node_data_field_prioritat__term_image_tid, term_data_node_data_field_prioritat.weight AS term_data_node_data_field_prioritat_weight, term_data_node_data_field_prioritat.name AS term_data_node_data_field_prioritat_name, term_data_node_data_field_prioritat.vid AS term_data_node_data_field_prioritat_vid, term_data_node_data_field_prioritat.tid AS term_data_node_data_field_prioritat_tid, node_data_field_estat.field_estat_value AS node_data_field_estat_field_estat_value, term_data_node_data_field_estat__term_image.tid AS term_data_node_data_field_estat__term_image_tid, term_data_node_data_field_estat.name AS term_data_node_data_field_estat_name, term_data_node_data_field_estat.vid AS term_data_node_data_field_estat_vid, term_data_node_data_field_estat.tid AS term_data_node_data_field_estat_tid, term_data_node_data_field_assignat.name AS term_data_node_data_field_assignat_name, term_data_node_data_field_assignat.vid AS term_data_node_data_field_assignat_vid, term_data_node_data_field_assignat.tid AS term_data_node_data_field_assignat_tid, node.created AS node_created, node.changed AS node_changed FROM node node LEFT JOIN content_field_assignat node_data_field_assignat ON node.vid = node_data_field_assignat.vid LEFT JOIN term_data term_data_node_data_field_assignat ON node_data_field_assignat.field_assignat_value = term_data_node_data_field_assignat.tid LEFT JOIN content_type_baca_tasques node_data_field_estat ON node.vid = node_data_field_estat.vid LEFT JOIN term_data term_data_node_data_field_estat ON node_data_field_estat.field_estat_value = term_data_node_data_field_estat.tid LEFT JOIN term_data term_data_node_data_field_prioritat ON node_data_field_estat.field_prioritat_value = term_data_node_data_field_prioritat.tid INNER JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN term_image term_data_node_data_field_prioritat__term_image ON term_data_node_data_field_prioritat.tid = term_data_node_data_field_prioritat__term_image.tid LEFT JOIN term_image term_data_node_data_field_estat__term_image ON term_data_node_data_field_estat.tid = term_data_node_data_field_estat__term_image.tid WHERE (term_node.tid IN (1, 9, 28)) AND (node.type in ('baca_tasques')) AND (node_data_field_estat.field_estat_value IN ('45', '46')) AND (node_data_field_assignat.field_assignat_value IN ('15', '27', '52', '55', '26', '25')) ORDER BY term_data_node_data_field_prioritat_weight ASC ) count_alias in /my_install_directory/sites/all/modules/views/includes/view.inc on line 705.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), term_data.name AS term_data_name, term_data.vid AS ter' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), term_data.name AS term_data_name, term_data.vid AS term_data_vid, term_data.tid AS term_data_tid, node.title AS node_title, node_data_field_estat.field_prioritat_value AS node_data_field_estat_field_prioritat_value, node.type AS node_type, node.vid AS node_vid, term_data_node_data_field_prioritat__term_image.tid AS term_data_node_data_field_prioritat__term_image_tid, term_data_node_data_field_prioritat.weight AS term_data_node_data_field_prioritat_weight, term_data_node_data_field_prioritat.name AS term_data_node_data_field_prioritat_name, term_data_node_data_field_prioritat.vid AS term_data_node_data_field_prioritat_vid, term_data_node_data_field_prioritat.tid AS term_data_node_data_field_prioritat_tid, node_data_field_estat.field_estat_value AS node_data_field_estat_field_estat_value, term_data_node_data_field_estat__term_image.tid AS term_data_node_data_field_estat__term_image_tid, term_data_node_data_field_estat.name AS term_data_node_data_field_estat_name, term_data_node_data_field_estat.vid AS term_data_node_data_field_estat_vid, term_data_node_data_field_estat.tid AS term_data_node_data_field_estat_tid, term_data_node_data_field_assignat.name AS term_data_node_data_field_assignat_name, term_data_node_data_field_assignat.vid AS term_data_node_data_field_assignat_vid, term_data_node_data_field_assignat.tid AS term_data_node_data_field_assignat_tid, node.created AS node_created, node.changed AS node_changed FROM node node LEFT JOIN content_field_assignat node_data_field_assignat ON node.vid = node_data_field_assignat.vid LEFT JOIN term_data term_data_node_data_field_assignat ON node_data_field_assignat.field_assignat_value = term_data_node_data_field_assignat.tid LEFT JOIN content_type_baca_tasques node_data_field_estat ON node.vid = node_data_field_estat.vid LEFT JOIN term_data term_data_node_data_field_estat ON node_data_field_estat.field_estat_value = term_data_node_data_field_estat.tid LEFT JOIN term_data term_data_node_data_field_prioritat ON node_data_field_estat.field_prioritat_value = term_data_node_data_field_prioritat.tid INNER JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN term_image term_data_node_data_field_prioritat__term_image ON term_data_node_data_field_prioritat.tid = term_data_node_data_field_prioritat__term_image.tid LEFT JOIN term_image term_data_node_data_field_estat__term_image ON term_data_node_data_field_estat.tid = term_data_node_data_field_estat__term_image.tid WHERE (term_node.tid IN (1, 9, 28)) AND (node.type in ('baca_tasques')) AND (node_data_field_estat.field_estat_value IN ('45', '46')) AND (node_data_field_assignat.field_assignat_value IN ('15', '27', '52', '55', '26', '25')) ORDER BY term_data_node_data_field_prioritat_weight ASC LIMIT 0, 20 in /my_install_directory/sites/all/modules/views/includes/view.inc on line 731. 
mh86’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Fixed

you shouldn't make that long queries, your mysql server will slow down! start with smaller views configurations.
there is definitely something wrong at the beginning with: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid)
...

castawaybcn’s picture

It was my view being poorly configured, sorry about the confusion. In fact you helped a lot just by saying "start with smaller views configurations".
I did, and I now have a much simpler and faster configuration for my view, and without any duplicates ;)

Status: Fixed » Closed (fixed)

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

TommyGuns’s picture

I couldnt derive a fix form this. My view is pretty simple already but spits out a syntax error as soon as I utilise distinct. Doesnt seem to be a slution for this around, alot of talk about it, maybe something for 5/7 and 7 but no 6/6.2 any help would be greatly appreciated.

Jb33’s picture

I have the same issue with 6.x-1.0-rc2

Jb33’s picture

Version: 6.x-1.0-beta6 » 6.x-1.0-rc2
Status: Closed (fixed) » Needs work