? 6-validate.patch
? 6-x-conf-ignore.patch
? 683400-redirect.patch
? 710712-domain-DRUPAL-6--2.patch
? 752570-reset-2.patch
? 752570-reset.patch
? 752570-static.patch
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.134.2.13
diff -u -p -r1.134.2.13 domain.module
--- domain.module	18 Mar 2010 15:05:56 -0000	1.134.2.13
+++ domain.module	28 Mar 2010 17:04:15 -0000
@@ -1177,6 +1177,9 @@ function domain_nodeapi(&$node, $op, $a3
       $_SESSION['domain_save_id'] = $domain['domain_id'];
       break;
     case 'presave':
+      // Reset the static lookup for this node.
+      domain_get_node_domains($nid, TRUE);
+      // Generate data for Devel Generate.
       if (!empty($node->devel_generate)) {
         // Build $domains array based on domains checked in the generate form
         // and shuffle for randomization
@@ -1254,14 +1257,22 @@ function domain_get_path_match($path) {
  *
  * @param $nid
  *   The node id.
+ * @param $reset
+ *   A bollean flag indicating the need to reset the static variable for the node.
  * @return
  *   An array, consisting of two parts. 'domain_id' is an array of active domain ids. 'domain_site'
  *   is a TRUE/FALSE boolean indicating affiliate status.
  */
-function domain_get_node_domains($nid) {
+function domain_get_node_domains($nid, $reset = FALSE) {
   static $lookup = array();
   if (isset($lookup[$nid])) {
-    return $lookup[$nid];
+    if (empty($reset)) {
+      return $lookup[$nid];
+    }
+    else {
+      unset($lookup[$nid]);
+      return;
+    }
   }
   $domains = array('domain_id' => array(), 'domain_site' => FALSE);
   $result = db_query("SELECT gid, realm FROM {domain_access} WHERE nid = %d AND (realm = '%s' OR realm = '%s')", $nid, 'domain_id', 'domain_site');
