From b01bb27ad3e461accb7c7e4528629f076905a22e Mon Sep 17 00:00:00 2001
From: Chris Pliakas <cpliakas@266779.no-reply.drupal.org>
Date: Mon, 21 Mar 2011 11:19:39 -0400
Subject: [PATCH] Issue #797904 by bdimofte, cpliakas: Fixed token caching issue.

---
 auto_nodetitle.module |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/auto_nodetitle.module b/auto_nodetitle.module
index c35a271..21cea63 100644
--- a/auto_nodetitle.module
+++ b/auto_nodetitle.module
@@ -133,6 +133,9 @@ function auto_nodetitle_operations_update($nodes) {
 function _auto_nodetitle_patternprocessor($output, $node) {
   if (module_exists('token')) {
     $output = token_replace($output, 'node', $node);
+    // Flush static token cache to avoid tokens being replaced with stale data.
+    // @see http://drupal.org/node/797904
+    token_replace($output, 'node', $node, TOKEN_PREFIX, TOKEN_SUFFIX, array(), TRUE);
   }
   if (variable_get('ant_php_'. $node->type, 0)) {
     $output = auto_nodetitle_eval($output, $node);
-- 
1.7.4.1

