Hello,
I've been using node clone to copy content which is also using Field Collections. Within the collection are text, attachment and link fields. After cloning the node, changes that I make to pre-existing fields on the clone are also taking effect on the original. E.g. removing attachments, adding links using add another item, editing the text field etc. The changes are also made in the other direction - edits to the original affect clone.
Additionally, the Field Collection is set to unlimited, which allows me to add more items to the node. Items added after the clone do not appear to be affected as described above.
Thoughts?
Comments
Comment #1
lelizondo CreditAttribution: lelizondo commentedI'm having the same problem using Panelizer and Page Manager
Comment #2
DamienMcKennaI'm going to work on the Panelizer compatibility on Monday-ish, will report back in #2375563: Compatibility with Node Clone.
Comment #3
lelizondo CreditAttribution: lelizondo commentedThe problem is that the fieldable panels panes id is just copied as it. I had to loop through all of the FPP, clone them and then assign the new ids to the new node. If you need to see my implementation I'd be glad to share it but I'm afraid is not a general solution.
Comment #4
pwolanin CreditAttribution: pwolanin commentedI'm honestly not sure how field collections are implemented. This is not something I would really expect to work OOTB.
Please indicate if you are willing to provide a patch for Field Collections support, otherwise I'll just close this.
Comment #5
lelizondo CreditAttribution: lelizondo commentedI don't think this will work out of the box ether, this is the code I'm using in case anyone needs it:
Comment #6
DamienMcKennaLets simplify this request. The desire is for data stored in Field Collections to be exportable via Node Clone.
Comment #7
DamienMcKennaFYI Field Collections are stored as an entity object. And I don't think this issue should be closed until it's made to work.
Comment #8
pwolanin CreditAttribution: pwolanin commented@DamienMcKenna - I really don't think this belongs in the base module. Field collections are neither simple to copy (I expect) nor part of core or very central contrib.
Comment #9
DamienMcKennaSo, do you think Field Collection should implement hook_clone_node_alter() to load the full objects prior to cloning?
Comment #10
pwolanin CreditAttribution: pwolanin commentedDid you look at the add-on module referenced here: #2279659: Point users to the Field Collection Node Clone module
Comment #11
DamienMcKenna.. oh. I wish they'd built it as a patch for either Node Clone or Field Collection, rather than needing a third module.