Hi!
I have a bundle of simple fields (text and textarea) which are grouped together in a field collection (http://drupal.org/project/field_collection) This bundle is embedded as a field into a node.
I can see the field_collection field inside the UI so it is recognized by migrate together with the other fields in this node. But how can I put data into the collection fields? Will I have to import the field_collections fields seperatly and build the relationship to the node who uses this field bundle later in a second run? Or is it possible to populate the node fields and the embeded field_collection entity in one run?
I found this Entity_API plugin (http://drupal.org/node/1133914) provided by the commerce guys. As field collection is using Entity_API I think this would add support for field collections as well.
Can someone provide an example howto achieve such an import? Or maybe some tips where to start? Maybe there is already something in the examples I didn't get that there is already dealed with this problem.
Kind regrads and thank you
Marcus
Comments
Comment #1
mikeryanI haven't used field_collection, but I imagine it probably needs its own field handler. Moving to migrate_extras, where contrib module support is.
Comment #2
inversed commentedI would like to use the Feeds module to import data into nodes that use a field collection. Any leads on where to get started on this would be appreciated.
Comment #3
richygecko commentedMarcus,
I'm going to be doing this in the next few days as well. I have tried to use the entity_api plugin for profiles but I had to alter it a bit for profile2 entities. I think it should work for field-collections though.
As a basic test, i created a quick migration class and added the following (don't forget to add the new migration into your .info file! :p)
Make changes as neccessary and then under migrations i see that the fields i have added to my field collection are listed under destination. Hope this helps.
Comment #4
marcusx commented@richygecko
Great! I need it desperatly but I had no time to write handling stuff for that so far. I will test your solution and post also my code if I need to add something.
Comment #5
grendzy commentedI've posted a working destination class in the field_collection queue: #1175082: Field collection field handler for migrate module.
Comment #6
mikeryanOK, let's follow the progress over there: #1175082: Field collection field handler for migrate module..
Comment #7
anybodySee also #1063434: Add Feeds integration to FieldCollection