--- domain.module 2010-03-18 23:05:56.000000000 +0800 +++ domain-fix-lookup.module 2010-03-26 15:36:59.000000000 +0800 @@ -1259,7 +1259,12 @@ function domain_get_path_match($path) { * is a TRUE/FALSE boolean indicating affiliate status. */ function domain_get_node_domains($nid) { - static $lookup = array(); + global $_domain; + if (isset($_domain['lookup'])) { + $lookup = $_domain['lookup']; + } else { + $lookup = array(); + } if (isset($lookup[$nid])) { return $lookup[$nid]; } @@ -1276,6 +1281,7 @@ function domain_get_node_domains($nid) { } } $lookup[$nid] = $domains; + $_domain['lookup'] = $lookup; return $lookup[$nid]; } @@ -1474,6 +1480,12 @@ function _domain_store_grants($nid, $gra foreach ($grants as $grant) { db_query("INSERT INTO {domain_access} (nid, gid, realm) VALUES (%d, %d, '%s')", $nid, $grant['gid'], $grant['realm']); } + + global $_domain; + if (isset($_domain['lookup'])) { + unset($_domain['lookup'][$nid]); + } + } // Ensure that our default grant is present. domain_set_default_grant();