I have field collection with only file fields. You can investigate - in this case $form won't contain #entity property which is necessary for altering it. So I've created small patch.

CommentFileSizeAuthor
#3 field_collection.patch513 bytesGeorgique
field_collection.patch689 bytesGeorgique
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Georgique’s picture

Version: 7.x-1.0-beta5 » 7.x-1.x-dev
Status: Active » Needs review

My patch is generated by PhpStorm, not sure it will pass check but let's try...

Status: Needs review » Needs work

The last submitted patch, field_collection.patch, failed testing.

Georgique’s picture

Status: Needs work » Needs review
FileSize
513 bytes

Removing my local garbage from the patch

jmuzz’s picture

Issue summary: View changes
Status: Needs review » Closed (cannot reproduce)

I wasn't able to duplicate this with the latest repository version of field collections and 7.x-2.0-alpha3 of file_entity. I made a node with a field collection that had a file field and I was able to change the file in it. It is an old issue so I believe it is not a problem now, but if I am wrong please reopen with more details about how to reproduce.

Georgique’s picture

Status: Closed (cannot reproduce) » Needs review

I have a node with a field of field_collection type. When I am trying to edit this field I have no $form['#entity] property. And for me (and obviously it can be pretty common case) I want to get access to field_collection_item which is being edited.

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch in #3 to field_collection.pages.inc does not apply to the latest field_collection 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch field_collection.pages.inc...
error: while searching for:

  field_attach_form('field_collection_item', $field_collection_item, $form, $form_state);

  $form['actions'] = array('#type' => 'actions', '#weight' => 50);
  $form['actions']['submit'] = array(
    '#type' => 'submit',

error: patch failed: field_collection.pages.inc:32
error: field_collection.pages.inc: patch does not apply