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.
Hello.
You have alter hook that allow change replica object before save. But i need replicate thee of nodes. And children nodes has link to root node. After replicate root node i start replicate children nodes and change ID of parent node to new. But for do it i must have id of a new root node. But i can't get this id from alter hook because it's not yet created.
For solve this problem i need hook that call after node saved and return new cloned node.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#3 | replicate-hook-after-save-2396797-3.patch | 2.43 KB | jgalletta |
replicate.patch | 421 bytes | Manyahin | |
Comments
Comment #1
btopro CreditAttribution: btopro commentedMakes sense to me, minor API addition / flexibility that would allow for things like entities that have direct relation (such as book / OG) being replicated and related to replicated parents correctly / allow for replication chaining
Comment #2
vbouchetI agree that would add some flexibility. However, I am not sure using drupal_alter() is the best approach as we basically don't alter anything but only give the opportunity to act on related "things". module_invoke() is probably a better approach from my point of view.
Comment #3
jgalletta CreditAttribution: jgalletta commentedAdded a hook and modified the api file to explain how to use it. Tell me what you think about it.
Comment #4
btopro CreditAttribution: btopro commentedlooks reasonable; if we have an entity and it's just been replicated, then allow stuff to fire
Comment #6
jgalletta CreditAttribution: jgalletta commentedComment #8
chrisrockwell CreditAttribution: chrisrockwell commentedIf you can't use -dev version of this, replicate_entity does return the new id.
Pardon my ignorance here, but is there somewhere we can track what is stopping -dev from graduating? Edit to be more clear: If you can point me to the issues that are preventing dev from graduating, I'll see if I can help with any of them.