Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1169
diff -u -p -r1.1169 node.module
--- modules/node/node.module	19 Nov 2009 04:00:47 -0000	1.1169
+++ modules/node/node.module	24 Nov 2009 15:46:17 -0000
@@ -1034,7 +1034,14 @@ function node_save($node) {
   
     // Clear the page and block caches.
     cache_clear_all();
-  
+
+    // Clear the static cache of nodes. Since the content of one node can
+    // depend arbitrarily on the content of another (for example, via a text
+    // filter or field that renders part of one node inside of another), it is
+    // not sufficient to refresh only the node that is being saved; instead,
+    // all nodes must be refreshed.
+    entity_get_controller('node')->resetCache();
+
     // Ignore slave server temporarily to give time for the
     // saved node to be propagated to the slave.
     db_ignore_slave();
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.56
diff -u -p -r1.56 node.test
--- modules/node/node.test	19 Nov 2009 04:00:47 -0000	1.56
+++ modules/node/node.test	24 Nov 2009 15:46:17 -0000
@@ -821,6 +821,43 @@ class NodeSaveTestCase extends DrupalWeb
   }
 
   /**
+   * Test that changes made by node_save() are reflected in node_load().
+   */
+  function testNodeSaveWithNodeLoad() {
+    // Create an initial node and save it.
+    $node = array(
+      'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => 'Original title'))),
+      'body' => array(FIELD_LANGUAGE_NONE => array(array('value' => 'Original body'))),
+      'status' => NODE_NOT_PUBLISHED,
+      'uid' => $this->web_user->uid,
+      'type' => 'article',
+    );
+    $node = (object)$node;
+    node_save($node);
+
+    // Load it and make sure it contains the data we expect.
+    $loaded_node = node_load($node->nid);
+    $this->assertEqual($loaded_node->title[FIELD_LANGUAGE_NONE][0]['value'], 'Original title', t("A saved node's title is correctly returned by node_load()."));
+    $this->assertEqual($loaded_node->body[FIELD_LANGUAGE_NONE][0]['value'], 'Original body', t("A saved node's body is correctly returned by node_load()."));
+    $this->assertEqual($loaded_node->status, NODE_NOT_PUBLISHED, t("A saved node's status is correctly returned by node_load()."));  
+
+    // Clone the node (so we know we are working with an entirely separate
+    // object), then make changes to it and save it again.
+    $cloned_node = clone $loaded_node;
+    $cloned_node->title[FIELD_LANGUAGE_NONE][0]['value'] = 'New title';
+    $cloned_node->body[FIELD_LANGUAGE_NONE][0]['value'] = 'New body';
+    $cloned_node->status = NODE_PUBLISHED;
+    node_save($cloned_node);
+
+    // Load the node again and check that the changes are reflected. This
+    // asserts that node_load() is not returning stale cached data.
+    $reloaded_node = node_load($node->nid);
+    $this->assertEqual($reloaded_node->title[FIELD_LANGUAGE_NONE][0]['value'], 'New title', t("A saved node's title is correctly returned by node_load(), even when an older version of the node was loaded before."));
+    $this->assertEqual($reloaded_node->body[FIELD_LANGUAGE_NONE][0]['value'], 'New body', t("A saved node's body is correctly returned by node_load(), even when an older version of the node was loaded before."));
+    $this->assertEqual($reloaded_node->status, NODE_PUBLISHED, t("A saved node's status is correctly returned by node_load(), even when an older version of the node was loaded before."));
+  }
+
+  /**
    * Import test, to check if custom node ids are saved properly.
    * Workflow:
    *  - first create a piece of content
