You are here

function content_lock_node_update in Content locking (anti-concurrent editing) 7

Same name and namespace in other branches
  1. 7.3 content_lock.module \content_lock_node_update()
  2. 7.2 content_lock.module \content_lock_node_update()

Implement hook_node_update() to unlock a node after it's saved.

This hook is invoked after hook_node_save() is invoked and after the changes to the node are actually saved to the database, so it's the right place to unlock a modified node.

Parameters

$node: The node which was saved.

File

./content_lock.module, line 137
Allows users to lock documents for modification.

Code

function content_lock_node_update($node) {
  global $user;
  if (_content_lock_is_lockable_node($node)) {
    content_lock_release($node->nid, $user->uid);
  }
}