Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | field_collection.patch | 513 bytes | Georgique |
field_collection.patch | 689 bytes | Georgique | |
Comments
Comment #1
Georgique CreditAttribution: Georgique commentedMy patch is generated by PhpStorm, not sure it will pass check but let's try...
Comment #3
Georgique CreditAttribution: Georgique commentedRemoving my local garbage from the patch
Comment #4
jmuzz CreditAttribution: jmuzz commentedI 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.
Comment #5
Georgique CreditAttribution: Georgique commentedI 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.
Comment #6
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 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.