Comments

webankit’s picture

This is a very much needed in this gr8 module

webankit’s picture

This is a very much needed in this gr8 module

joostvdl’s picture

Subscribe

cfennell’s picture

subscribe

Ciprian Oancia’s picture

+

fago’s picture

Shadlington’s picture

Subscribe

gaintsev’s picture

Subscribe

casey’s picture

Category: feature » task
Stefan Haas’s picture

subscribe

RobW’s picture

Currently field collections shows up naturally in some views results, for instance as a containing entity for other fields. Is there any way with relationships to get that connection between node and attached field collection? If this connection can be made there would be a lot you could do with field collections right there. I've been experimenting but I haven't had any success.

mstrelan’s picture

+1 on what RobW said in #11

marcusx’s picture

subscribe

blenny’s picture

Using the Field-collection item in Views, Grouping doesn't work. I get the following error when I sum a field...

'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'field_data_field_qty.field_qty\' in \'field list\''
in views_plugin_query_default->execute() (line 1354 of /Applications/MAMP/htdocs/website.com/modules/views/plugins/views_plugin_query_default.inc).

hnln’s picture

sub

cyberwolf’s picture

subscribing

chrisroditis’s picture

Has anyone found a way to what RobW describes at #11? Get the connection between node and attached field collection with a views relationship?

Gemma Morton’s picture

For #11 and #17, take a look at this: http://drupal.org/node/1172372

It provides only the following:
1) Entity with Field -> Field Collections info.

It would be great to provide the base in vise versa:
2) Field Collections -> Load Entity Info.

However, the first Relationship does work with the patch for each Field Collection (as Field), and will provide the fields to you to use to filter/argument/display.

Note: When used in the direction of 1, you will have multiple entries per field collection. IE:

Node Title | NID | Field Collection Name | Field Collection Phone Number |
Node 1 | 12 | Greg | 1234
Node 1 | 12 | Jack | 1236
Node 2 | 13 | Jill | 1211

etc

marcusx’s picture

Title: Views Integration? » Views Integration for field collection?

Changed title for better overview in the dashboard.

fago’s picture

Title: Views Integration for field collection? » [Meta] Views Integration for field collection

Let's use #1172372: Add Views Relationship to Field Collection - patch attached for adding the relationship - which should do it for most-cases - and keep this as a meta issue.

Although, we might want to add
* a reverse relationship allowing views listing field-collections to join to a host entity of a given entity type (=config option).
* a filter that allows one to list field-collections of a certain host-entity-type (by adding a filter for the field table's entity type column)

Jerome F’s picture

I tested the patch in http://drupal.org/node/977890#comment-4564324 with views - the result is here

There's something I don't understand completely about the views integration...
Why is there the same form twice in views for the field collection field? (I mean, the configuration form is displayed inside itself, like if it was embedded... The attached screenshot speaks for itself...)

And as a feature request, is it possible to have each field of the field collection available in the replacement pattern token in views? Or simply as views fields...

Appart from that the views integration is excellent.

Jerome F’s picture

StatusFileSize
new135.15 KB

Forgot to attach the screenshot here as well, for #21.

chriscalip’s picture

I wanted to voice some concern about the direction field_collection has taken, ie.
http://drupal.org/files/issues/views_field_collection_configuration_form...

The disadvantage of the above approach as a formatter is that each field in the field_collection structure is not exposed in the view; thus we could not really take advantage of views to take care of the rendering process of the fields inside the field collection structure but instead we are stuck in a static version of doing every field inside a formatter kinda like field_collection_table . Please take inspiration from cck multigroup which exposes the fields inside the multigroup and having the correct sync of it by adding a multigroup filter.

kind regards,
chriscalip

yched’s picture

Regarding the duplicate issues reported in #18 :
That's inherent to the fact that you have a relationshionship on a reference field with multiple values. That creates a JOIN which returns several rows for the same parent node. You'll find the same behavior with node_reference relationships on a noderef field with multiple values. Problem is that field_collections will by definition always be multiple.
node_reference works around this by using a dedicated relationship handler that has a user option to restrict to a given delta. Not entirely satisfying though.

Regarding the garbled field_collection field settings form in views reported in #20 / #21 : see #1227244: Bug in formatter settings in Views

vasike’s picture

Status: Active » Needs review
StatusFileSize
new1.61 KB

there is patch for having the Entity relationship for the field collection.
i use the solution from node reference, the reverse reference case (views_handler_relationship_entity_reverse - relationship handler)

it works for me. please review

Status: Needs review » Needs work

The last submitted patch, [Meta]_Views_Integration_for_field_collection-1047784-25.patch, failed testing.

vasike’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Needs work » Needs review
vasike’s picture

hefox’s picture

Working fine for me, but manually applied it after seeing testbot had troubles (and it's such a tiny patch)

tim.plunkett’s picture

Status: Needs review » Needs work

I think the testbot is broken due to #709464: Don't test core when testing contrib. There is a whitespace issue however, so marking needs work. I hope to have time to test this soon.

Remon’s picture

subs!

kleinmp’s picture

I tested this on a view based on profile2 with an unlimited field-collection field. By adding a relationship to the field-collection, I was able to list each field within the field-collection as a separate row in a table and it was exactly what I needed to do. So, this is working fine for me too.

thill_’s picture

#25 works for me as well

tim.plunkett’s picture

Status: Needs work » Fixed
carnity’s picture

Hi guys, I am pretty new to drupal and recently used your field collection module in my product catalog.

Its an excellent mod, but i want the table view should appear in vertical manner than horizontal. In my product i have about 16 fields which forces user to scroll horizontally.

Is it possible?

fago’s picture

Status: Fixed » Active

Patch generally looks good (except for the whitespace issue), however we should not implement the alter hook ourself, as this way other modules don't have the possibility to do alterations any more (without depending on the right order..).

Providing new array-keys works anyway with the main hook, so couldn't we just use the main-hook here? module_implements() merges together the results for us anyway.

tim.plunkett’s picture

Well I tried to fix the whitespace before committing, but I left out a space I guess.

I will look at fixing this today if I can, and I can ask kleinmp to test it again.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB

I'm going to let this sit for a little while to see what the response is on #1291088: Recursively merge field views data, but here is a patch to clean up the code in the meantime.

Note, this pattern follows image module's views implementation, but in that case, image_field_views_data_views_data_alter() is operating on a table it doesn't own, file_managed, whereas we're adding to our own table.

hnln’s picture

adding relations to the field collection relation seems to create problems, I can't add a file usage relation (to get e.g. file path) and when I add a node reference based relation to my field collection relation it results in column not found (Unknown column 'very_long_field_alias.nid' in 'on clause').

zilverdistel’s picture

I'm having the same issue as HnLn it seems. Updating to the latest views-dev introduced the unknown column error.

fago’s picture

Status: Needs review » Reviewed & tested by the community

Patch of #38 looks good to me in order to address #36. -> setting rtbc.

@#39,#40: Please open a separate issue for that. Let's only link issues from the META issue.

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett
Status: Reviewed & tested by the community » Needs work

Oh, that other patch got into Views. Will need to rework this.

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.74 KB

This shouldn't be committed until Views 7.x-3.x-rc2 is released.
You can use this now with a Views dev after November 1st.

bryancasler’s picture

Has this been comitted? It has prevented a few errors I was recieving.

tim.plunkett’s picture

Status: Needs review » Fixed

There is now a Views RC3, so I committed this.
http://drupalcode.org/project/field_collection.git/commit/790c8a9

Status: Fixed » Closed (fixed)

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

dandaman’s picture

Status: Closed (fixed) » Active

Here's some issue I'm having with this functionality in the final release version of Views: #1379008: Reverse entity Views relationship not associating with node field data

In my experience, it doesn't seem to be working correctly again (see related ticket for my problems/thoughts). Can anyone verify this?

tim.plunkett’s picture

Status: Active » Closed (fixed)

Let's leave this closed as it was a long running issue that did too much. Thank you for opening a new issue, I will take a look at it when I can.