Node postsave hook

Created on 25 September 2008, almost 16 years ago
Updated 18 July 2023, about 1 year ago

I have added this hook myself to my core for several custom modules.
It is especially useful when you need to act on a nodeid just after initial creation, such as applying changes to a node using the tokens module.

Without this, the nodeid will not exist until after the node has been created at which point you've lost the ability to hook it.

I currently use it in production for a much simpler way to deal with changing upload paths based on the node information. This never worked on initial node creation simply and smoothly until I added this hook.

I implemented this as a one line change to node.module:

  // Call the node specific callback (if any).

  node_invoke($node, $op);

  node_invoke_nodeapi($node, $op);

  node_invoke_nodeapi($node, 'postsave');



  // Update the node access table for this node.

  node_access_acquire_grants($node);

Alternate simple methods to achieve the same result are welcome.

✨ Feature request
Status

Closed: outdated

Version

9.5

Component
Node systemΒ  β†’

Last updated 1 minute ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States Daren Schwenke

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024