? boost-617476.patch
? boost-debug.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.207
diff -u -p -r1.3.2.2.2.5.2.207 boost.module
--- boost.module	28 Oct 2009 04:25:04 -0000	1.3.2.2.2.5.2.207
+++ boost.module	28 Oct 2009 22:51:50 -0000
@@ -411,7 +411,7 @@ function boost_comment($comment, $op) {
       // Expire the relevant node page from the static page cache to prevent serving stale content:
       if (!empty($comment['nid'])) {
         $node = node_load($comment['nid']);
-        boost_expire_node($node);
+        boost_expire_node($node, $comment['nid']);
       }
       break;
     case 'publish':
@@ -419,7 +419,7 @@ function boost_comment($comment, $op) {
     case 'delete':
       if (!empty($comment->nid)) {
         $node = node_load($comment->nid);
-        boost_expire_node($node);
+        boost_expire_node($node, $comment->nid);
       }
       break;
   }
@@ -480,7 +480,7 @@ function boost_votingapi_insert($votes) 
 
   foreach ($votes as $vote) {
     $node = node_load($vote['content_id']);
-    boost_expire_node($node);
+    boost_expire_node($node, $vote['content_id']);
   }
 }
 
@@ -495,7 +495,7 @@ function boost_votingapi_delete($votes) 
 
   foreach ($votes as $vote) {
     $node = node_load($vote['content_id']);
-    boost_expire_node($node);
+    boost_expire_node($node, $vote['content_id']);
   }
 }
 
@@ -504,14 +504,22 @@ function boost_votingapi_delete($votes) 
  *
  * @param $node
  *  node object
+ * @param $nid
+ *  node id
  */
-function boost_expire_node($node) {
-  if (empty($node->nid)) {
-    return FALSE;
-  }
+function boost_expire_node($node, $nid = 0) {
   $data = array();
   $paths = array();
 
+  if (empty($node->nid)) {
+    if ($nid) {
+      $node->nid = $nid;
+    }
+    else {
+      return FALSE;
+    }
+  }
+
   // Expire all relevant node pages from the static page cache to prevent serving stale content:
   if ($node->promote == 1) {
     $paths[] = '<front>';
@@ -541,22 +549,24 @@ function boost_expire_node($node) {
   if (BOOST_FLUSH_CCK_REFERENCES && module_exists('nodereference')) {
     $nids = array();
     $type = content_types($node->type);
-    foreach ($type['fields'] as $field) {
-      // Add referenced nodes to nids. This will clean up nodereferrer fields
-      // when the referencing node is updated.
-      if ($field['type'] == 'nodereference') {
-        $node_field = isset($node->$field['field_name']) ? $node->$field['field_name'] : array();
-        foreach ($node_field as $delta => $item) {
-          $nids[$item['nid']] = $item['nid'];
+    if ($type) {
+      foreach ($type['fields'] as $field) {
+        // Add referenced nodes to nids. This will clean up nodereferrer fields
+        // when the referencing node is updated.
+        if ($field['type'] == 'nodereference') {
+          $node_field = isset($node->$field['field_name']) ? $node->$field['field_name'] : array();
+          foreach ($node_field as $delta => $item) {
+            $nids[$item['nid']] = $item['nid'];
+          }
         }
       }
-    }
-    foreach ($nids as $nid) {
-      if (BOOST_NO_DATABASE) {
-        $paths[] = 'node/' . $nid;
-      }
-      else {
-        $data[] = array('base_dir' => BOOST_FILE_PATH, 'page_callback' => 'node', 'page_id' => $nid);
+      foreach ($nids as $nid) {
+        if (BOOST_NO_DATABASE) {
+          $paths[] = 'node/' . $nid;
+        }
+        else {
+          $data[] = array('base_dir' => BOOST_FILE_PATH, 'page_callback' => 'node', 'page_id' => $nid);
+        }
       }
     }
 
