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 can't export a field collection which is only defined in another field collection. Nowhere in the Features interface a "field instance" for the second field collection is selectable for export.
Since Features 7.x-2.0-beta2 fields are divided into two parts, base and instance. I think that is what is causing my problem.
Comment | File | Size | Author |
---|---|---|---|
#8 | field_collection-n1982184-8.patch | 2.15 KB | DamienMcKenna |
#6 | field_collection-cant-export-field-collection-with-features-1982184-6.patch | 1.02 KB | technicalknockout |
#4 | 1982184_export_instances_4.patch | 1.18 KB | wizonesolutions |
Comments
Comment #1
wizonesolutionsI have the same problem. Did you ever find a workaround in the end?
I'm going to dare to raise this to major and hopefully get some attention on it. Also, I'll see if it's a quick fix, e.g. what they did in Features itself to make this work with nodes.
Comment #2
wizonesolutionsAlright, I have found a solution. It's really simple. The function
field_collection_features_pipe_field_alter
infield_collection.module
needs to be renamed tofield_collection_features_pipe_field_instance_alter
.It appears Features doesn't call the former anymore.
My version of Field Collection is already patched, so I can't provide a patch quite yet, but I will do some Git magic and post one soon.
Comment #3
wizonesolutionsOh, forgot one thing. Change:
to:
Comment #4
wizonesolutionsHere's the patch.
Comment #6
technicalknockout CreditAttribution: technicalknockout commentedLooks like you might have built the patch in a repository other than the module's - just learning how to make these patches myself so I figured I'd give re-rolling it a try.
Comment #7
DamienMcKennaThis needs to support both the old and new APIs, for sites that have not upgraded to Features v2 yet.
Comment #8
DamienMcKennaThis patch adds field_collection_features_pipe_field_instance_alter() instead of replacing field_collection_features_pipe_field_alter(). It also adds a check to see if the new field_instance functionality is available before field_collection_features_pipe_field_alter() returns anything, to avoid unnecessarily causing problems by defining both the new 'field_instances' and the legacy 'field' values. Lastly, the docbook comments have been made more verbose to explain what is going on.
Comment #9
wizonesolutionsThanks for the rerolls :)
Comment #10
pcoucke CreditAttribution: pcoucke commentedThis patch works for me on field collection 7.x-1.0-beta5 with features 7.x-2.0-rc1.
Comment #11
acrollet CreditAttribution: acrollet commentedPatch in #8 also works nicely for me.
Comment #12
fagoThanks, committed.