Working with an earlier version of Field Collection, I added a File upload field, specifically for uploading PDFs, to a field collection item, and it appeared to be working fine. I need to bundle the PDF upload with a description and title field, and offer multiple instances of this bundle, so Field Collection looked like the ideal solution.

However, somewhere in a recent update, this isn't working anymore. I can use the file browser, grab the local file, and click Upload, but once the upload is complete, the file doesn't show up in either the back end or front end. Checking the remote folder, I discovered that the file *is* uploading to the server fine. It's just not coming up in the interface for some reason. I've tried using FieldField Sources along with the IMCE browser, and again, it's a similar effect - I can browse and select the file fine, but once the field finishes processing, it doesn't show up.

Here's what I'm currently using:

Field Collection 7.1-1.x-dev (downloaded the latest today)
Entity API 7.x-1.0-beta9
File Field Sources 7.x-1.4
IMCE 7.x-1.3
Media 7.x-1.0-beta4 (probably not related, but I thought I'd mention anyway)

I'm not seeing any errors, either through Devel or with Firebug for Drupal, but if anybody has any thoughts on where else to look, I'm all ears.

I'm a relative newb to Drupal, so hopefully I'm not missing something obvious here.

Comments

junander’s picture

More on this - When I save the content type with the field collection fields I'm getting this error:

"Exception: The host entity may be set only during creation of a field-collection item. in FieldCollectionItemEntity->setHostEntity() (line 191 of /public_html/drupalsandbox/sites/all/modules/field_collection/field_collection.module)."

Also reported here:

http://drupal.org/node/1204428

munkyonline’s picture

I'm getting exactly the same error with an imagefield which isnt even within the embedded field collection attached to this content type. The image is uploading into the public folder and is being added to the file_managed table with a status of 0 (temporary).

If I delete the image from the public folder and try and upload then it causes an ajax error I presume because the file is still in the file_managed table.

When I try and save the page I also get "The website encountered an unexpected error. Please try again later."

Then looking in the error log I see the same message as mentioned by junander in comment #1.

If I change the field collection to hidden instead of embedded then this issue is no longer there.

munkyonline’s picture

This also looks like the same issue here: http://drupal.org/node/1204428 and http://drupal.org/node/1197094

junander’s picture

Yes, and I think it may be a duplicate of this issue: http://drupal.org/node/1187010

I also discovered that selecting a file and saving the node *instead* of clicking "Upload" works to properly attach the file and display it.

fago’s picture

Status: Active » Closed (duplicate)

Yep, let's handle the file upload problem in http://drupal.org/node/1187010