From 08cbd320f762036206b2c4f24da87b28ee314084 Mon Sep 17 00:00:00 2001
From: Christopher Reay <gituser@christopherreay.com>
Date: Sat, 16 Jul 2011 03:08:04 +0100
Subject: [PATCH] Allow the use of NID in php and [token]
 Changed the nauto_nodetitle_nodeapi to use insert. And then resave the node

Might be evil, an unexpected bonus is the pathauto also works. No idea why. Probabaly as I configured pathauto to just update the path regardless of any settings (as in hacked it) and it must be getting in there on node_save
---
 auto_nodetitle.module |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/auto_nodetitle.module b/auto_nodetitle.module
index c7d2073..6943b92 100644
--- a/auto_nodetitle.module
+++ b/auto_nodetitle.module
@@ -62,8 +62,9 @@ function auto_nodetitle_node_form_submit($form, &$form_state) {
  * Implementation of hook_nodeapi().
  */
 function auto_nodetitle_nodeapi(&$node, $op) {
-  if ($op == 'presave' && auto_nodetitle_is_needed($node)) {
+  if ($op == 'insert' && auto_nodetitle_is_needed($node)) {
     auto_nodetitle_set_title($node);
+    node_save($node);
   }
 }
 
-- 
1.7.1

