Hello,

when you have an image inside the field collection and
do a preview of the node, the image doesn't appear.

Is there a solution for this behavior?

Thank you!

Files: 
CommentFileSizeAuthor
#13 fetch_field_collection_images_when_previewing-1447338-13.patch2.11 KBcolan
PASSED: [[SimpleTest]]: [MySQL] 132 pass(es).
[ View ]
#12 fetch_field_collection_images_when_previewing-1447338-12.patch2.04 KBcolan
PASSED: [[SimpleTest]]: [MySQL] 132 pass(es).
[ View ]
#9 2.png2.79 KBmck
#9 1.png3.71 KBmck
#7 image-preview-missing-1447338-7.patch1.28 KBcolinafoley
PASSED: [[SimpleTest]]: [MySQL] 132 pass(es).
[ View ]

Comments

Still no luck with this issue.

This is an issue with all filefields inside field collections.

Is there a solution to this problem?

Thank you!

I concur that this is an active issue. I have a field_slideshow and a field collection with a single image. These are the warnings I get when I preview a field collection with a slideshow:

    Notice: Undefined index: uri in field_slideshow_field_formatter_view() (line 581 of /var/www/hmcc/sites/all/modules/field_slideshow/field_slideshow.module).
Warning: getimagesize(): Filename cannot be empty in template_preprocess_field_slideshow() (line 843 of /var/www/hmcc/sites/all/modules/field_slideshow/field_slideshow.module).

This is the warning I get when I have a simple field collection with an Image field:

    Notice: Undefined index: uri in theme_image_formatter() (line 602 of /var/www/hmcc/modules/image/image.field.inc).

Since it is happening in both collection types I suspect it is related. Thanks in advance for your suggestions.

Version:7.x-1.x-dev» 7.x-1.0-beta5

I am having this issue of my images in the field collection not displaying in preview mode. Is this still an open issue? I was trying to use field collection for my slideshow and carousels (two separate items - the carousel is not a pager) because I wanted to create multiple slide groups containing an image, caption, and link. It works great except that users can't preview their work. Any suggestions would be greatly appreciated. I am getting the Notice: Undefined index: uri in theme_image_formatter() error.

hi mrparsa

I had the same problem and the same warning!
I solved the problem this way:

1. go here: structure>field collections>manage display
2.change the format to: "Rendered file" (notice: I've installed "Media" module)
3.click on the gear icon.
4.change the view mode to: large, small or medium

and 5.save

hope this works for you

Version:7.x-1.0-beta5» 7.x-1.x-dev
Component:User interface» Code
Category:feature» bug
Status:Active» Needs review
StatusFileSize
new1.28 KB
PASSED: [[SimpleTest]]: [MySQL] 132 pass(es).
[ View ]

So, this seems pretty sloppy to me. I feel like having to get the field_instances and field_info at this step is wrong, but I didn't know how else to do this in a generic way.

This patch works at the FieldCollectionItemEntity level so it fixes this issue for both field_collection and field_collection_table. I chatted with tim.plunkett on IRC and he suggested using hook_field_formatter_prepare_view() initially. I was dissatisfied after exploring this approach because it would have required an additional patch for field_collection_table. Additionally, I really feel the issue is at the FieldCollectionItemEntity level since it seems like sometimes the necessary field data is being loaded (viewing the entity) and sometimes it is not being loaded (previewing the entity).

Please note: This is only a fix for image fields, not all file fields.

#7 method doesn't work

StatusFileSize
new3.71 KB
new2.79 KB

I have solved the problem without applying any patches, all you have to do is to add to the 'Relationship' field of it then add the image field to the fields section then select the 'Relationship' of the field collection image field.

Sorry for the bad english. I'm not good in grammar :D

My problem was:
I want to preview a node with a "normal" image field and a field collection containing an image field
and I got the Notice: Undefined index: uri in theme_image_formatter() error.
No views included!

For me #7 is working flawlessly, so I guess there are multiple issues?

BTW: During my debugging I came to the solution that field_collection_field_load as an implementation of hook_field_load is missing, but since I'm not very familar with the code of field collections and #7 is working for me, I guess I'm wrong here. ;-)

Patch #7 works well on beta5 module version. I hope they will fix this bug and realase stable version soon.

Thx colinafoley, great work!

Issue summary:View changes
StatusFileSize
new2.04 KB
PASSED: [[SimpleTest]]: [MySQL] 132 pass(es).
[ View ]

@colinafoley: Thanks for your work on #7. It didn't work for me when adding a new translation with Entity Translation. The language code wasn't coming through. To fix, I got it from the environment.

StatusFileSize
new2.11 KB
PASSED: [[SimpleTest]]: [MySQL] 132 pass(es).
[ View ]

Sorry, forgot an isset().