I have a content types with 3 file fields, all of them can have an unlimited number of images. I need to make a view that returns the title of the content and the images name inside an array (I'm using amfphp with services). The problem is that when I add the relationship to the content field_pics fid I get as many duplicate nodes as the number of the images in the field:
EG:
[10] => stdClass Object
(
[nid] => 56
[node_title] => asd asd asd
[node_language] =>
[node_nid] => 56
)
[11] => stdClass Object
(
[nid] => 56
[node_title] => asd asd asd
[node_language] =>
[node_nid] => 56
)
This is the query:
SELECT node.nid AS nid, node.title AS node_title, node.language AS node_language, node.nid AS node_nid
FROM node node
LEFT JOIN content_field_colori node_data_field_colori ON node.vid = node_data_field_colori.vid
LEFT JOIN files files_node_data_field_colori ON node_data_field_colori.field_colori_fid = files_node_data_field_colori.fid
WHERE (node.status <> 0 OR (node.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1) AND (node.type in ('prodotto'))
ORDER BY node_nid ASC
I don't know how to fix this.
ANy help is appreciated.
Thanks