I need to create a table style view that has separate columns for each field of each instance (delta) of a field collection. I was able to implement this by copying from the references module. See http://drupalcode.org/project/references.git/blob/refs/heads/7.x-2.x:/vi... for an example.

I haven't written a patch because I couldn't figure out how to get views to load the file for my new handler, so I just stuck it directly in the existing field_collection.views.inc file. I might try again later and submit a patch.

My use case is this: I am setting up a sports league management system and I have a content type of match. I have a field collection of team and the team has team name, score and a checkbox for if the team forfeited or not. The field collection has a max delta of 2 so basically I would have a relationship for delta 1 called "home team" and a relationship for delta 2 called "away team".

Files: 
CommentFileSizeAuthor
#5 field_collection-views_relationship_delta-1208346-5.patch3.38 KBeosrei
PASSED: [[SimpleTest]]: [MySQL] 80 pass(es).
[ View ]
#3 1208346-field_collection_views_relation_delta.patch2.78 KBmstrelan
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1208346-field_collection_views_relation_delta.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Comments

subscribe

Dammit I wish I wrote a patch because now I can't figure out how to get this to work.

Status:Active» Needs review
StatusFileSize
new2.78 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1208346-field_collection_views_relation_delta.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Here we go. Might need a cache flush or two, or maybe even forcing views to flush it's cache too.

Status:Needs review» Needs work

The last submitted patch, 1208346-field_collection_views_relation_delta.patch, failed testing.

Assigned:Unassigned» eosrei
Status:Needs work» Needs review
StatusFileSize
new3.38 KB
PASSED: [[SimpleTest]]: [MySQL] 80 pass(es).
[ View ]

This issue was created before mine, #1332452: Add result Delta to Views Relationship Handler. I set mine issue to Duplicate.

Status:Needs review» Reviewed & tested by the community

Looks pretty fine

works wonderfull!

Works

Assigned:eosrei» Unassigned
Status:Reviewed & tested by the community» Fixed

Cool thanks! I wish --author was used more often on d.o.

Git doesn't understand multiple authors, unfortunately. But I do try to use it when there is a clear single author.

I patched up -- does this provide sorting by delta? I can't seem to get that working.

Status:Fixed» Closed (fixed)

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

@mstrelan,
Thank you so much! I saved a lot of time for coding same relationship handler for Views :)