Posted by Gaara on May 5, 2011 at 5:29am
4 followers
| Project: | ImageField |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hello,
i don't know, If this is a views or imagefield problem, but imagefield maintainer said, this is a views missconfiguration.
I use views 6.3.x,dev and imagefield 6.3.9.
If I added a content profile->userpicture to a view all old fields a user has uploaded are also added as seperate rows to the view (see screensho)t. The admin uses the first image and has previously used the second image. Distinct is set to TRUE.
The generated sql-code for the view - There is much user relationships stuff, but problem also occurs on other views without user relationships. The problems didn't occured with views 2 before updating.
SELECT DISTINCT(user_relationships.rid) AS rid,
node_users_user_relationships_node_data_field_benutzerbild.field_benutzerbild_fid AS node_users_user_relationships_node_data_field_benutzerbild_f,
node_users_user_relationships_node_data_field_benutzerbild.field_benutzerbild_list AS node_users_user_relationships_node_data_field_benutzerbild_f_1,
node_users_user_relationships_node_data_field_benutzerbild.field_benutzerbild_data AS node_users_user_relationships_node_data_field_benutzerbild_f_2,
node_users_user_relationships.type AS node_users_user_relationships_type,
node_users_user_relationships.nid AS node_users_user_relationships_nid,
node_users_user_relationships.vid AS node_users_user_relationships_vid,
users_user_relationships.name AS users_user_relationships_name,
users_user_relationships.uid AS users_user_relationships_uid
FROM mypaed2user_relationships user_relationships
LEFT JOIN mypaed2users users_user_relationships ON user_relationships.requestee_id = users_user_relationships.uid
LEFT JOIN mypaed2users users_user_relationships_1 ON user_relationships.requester_id = users_user_relationships_1.uid
LEFT JOIN mypaed2node node_users_user_relationships ON users_user_relationships.uid = node_users_user_relationships.uid AND node_users_user_relationships.type = 'profile'
LEFT JOIN mypaed2content_type_profile node_users_user_relationships_node_data_field_benutzerbild ON node_users_user_relationships.vid = node_users_user_relationships_node_data_field_benutzerbild.vid
WHERE (user_relationships.approved = '1') AND (user_relationships.requester_id = 3 ))
Comments
#1
Can you show us a screenshot what you mean with "seperate rows for each upload"?
I guess you need the multi or delta field handler, which allows you to display multiple image per row, without chaning the sql query.
#2
sry, forgot the screenshot.
The imagefield normaly has one field. But in the view, the old values for this field are displayed too. Every user picture a user ever has uploaded is displayed in a seperate row.
#3
active (screenshot see last post)
#4
This might come from the delta. Add your imagefield delta also to the filters of the view and set it to below or equal 0. Every imagefield will have at least 0 even if there is none. This helped me - at least.
#5
don't know if this is weird, but my view provides no delta filter for the imagefield...
(Didn't find any on the filters list. :-/ )
#6
Move to imagefield issue queue, as they probably know why it's not offered.
#7
As other have stated, this is probably a misconfiguration in your view configuration.
The delta options aren't under the filters, they're in the field configuration. Click on the ImageField you've added to the view and find the "Group multiple values" box and make sure it's checked.