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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

btopro’s picture

Makes 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

vbouchet’s picture

I 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.

jgalletta’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
FileSize
2.43 KB

Added a hook and modified the api file to explain how to use it. Tell me what you think about it.

btopro’s picture

looks reasonable; if we have an entity and it's just been replicated, then allow stuff to fire

  • 0df9db2 committed on 7.x-1.x
    Ref #2396797 - Add hook after save.
    
jgalletta’s picture

Assigned: Manyahin » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

chrisrockwell’s picture

If 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.