? 6-validate.patch
? 624360-redirect.patch
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.134
diff -u -p -r1.134 domain.module
--- domain.module	1 Nov 2009 18:20:19 -0000	1.134
+++ domain.module	5 Nov 2009 16:54:52 -0000
@@ -1925,6 +1925,7 @@ function domain_invalid_domain_requested
  *   No return value. Issue a drupal_goto() if needed.
  */
 function domain_node_save_redirect() {
+  global $_domain;
   // If no session token, nothing to do.
   if (!isset($_SESSION['domain_nid'])) {
     return;
@@ -1933,26 +1934,7 @@ function domain_node_save_redirect() {
   // Unset the token now so as not to repeat this step.
   unset($_SESSION['domain_nid']);
   // Domain Source tells us where to go.
-  if (function_exists('domain_source_lookup')) {
-    $source = domain_source_lookup($nid);
-  }
-  // Otherwise, make an educated guess.
-  // TODO: Merge these lookup functions and make an alter hook.
-  else {
-    $domains = domain_get_node_domains($nid);
-    // If set to all affilaites, we don't care.
-    if (!empty($domains['domain_site'])) {
-      return;
-    }
-    $domain_id = current($domains['domain_id']);
-    if ($domain_id == -1) {
-      $source = domain_default();
-    }
-    else {
-      $source = domain_lookup($domain_id);
-    }
-  }  
-  // If issuing a redirect, make sure it is valid and to a visible domain.
+  $source = domain_get_node_match($nid);
   if ($source['domain_id'] != -1 && $source['domain_id'] != $_domain['domain_id'] && ($source['valid'] || user_access('access inactive domains'))) {
     drupal_goto($source['path'] . drupal_get_path_alias("node/$nid"));
   }
