? 6-validate.patch ? 6-x-conf-ignore.patch ? 683400-redirect.patch ? 710712-domain-DRUPAL-6--2.patch ? 752570-reset-2.patch ? 752570-reset-3.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:09:10 -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,15 +1257,29 @@ 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. + * @param $return + * Used with reset. Indicates that a new lookup should be run and the result returned. + * @see domain_nodeapi() * @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, $return = FALSE) { static $lookup = array(); if (isset($lookup[$nid])) { - return $lookup[$nid]; + // If set and valid, return. + if (empty($reset)) { + return $lookup[$nid]; + } + // If reset and no return needed, unset and return. + else if (empty($return)) { + unset($lookup[$nid]); + return; + } } + // Set the proper value for the node. $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'); while ($data = db_fetch_object($result)) {