Index: domain.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/domain/domain.module,v
retrieving revision 1.86
diff -u -r1.86 domain.module
--- domain.module	6 Nov 2008 16:32:07 -0000	1.86
+++ domain.module	21 Nov 2008 02:18:59 -0000
@@ -457,7 +457,10 @@
  * The $domain array from domain_domainload() or -1 on failure.
  */
 function domain_load($domain_id = NULL) {
-  return domain_lookup($domain_id);
+  if (is_numeric($domain_id)) {
+    return domain_lookup($domain_id);
+  }
+  return FALSE;
 }
 
 /**
Index: domain_content/domain_content.admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/domain/domain_content/domain_content.admin.inc,v
retrieving revision 1.5
diff -u -r1.5 domain_content.admin.inc
--- domain_content/domain_content.admin.inc	12 Oct 2008 23:23:43 -0000	1.5
+++ domain_content/domain_content.admin.inc	21 Nov 2008 03:52:26 -0000
@@ -42,15 +42,14 @@
  * @return
  *  A link group for each domain the user can access.
  */
-function domain_content_view($domain_id = NULL, $all_affiliates = FALSE) {
+function domain_content_view($domain = -1, $all_affiliates = FALSE) {
   global $_domain;
   // For users with limited privileges, we have to be on the same server
   // as the content we are looking up.  Will return -1 if it fails.
-  $domain = domain_lookup($domain_id);
   domain_goto($domain);
   $output = '';
   // Override the $_domain global so we can see the appropriate content
-  if (!is_null($domain_id)) {
+  if ($domain != -1) {
     $_domain['site_grant'] = FALSE;
     drupal_set_title(t('Content for !domain', array('!domain' => $_domain['sitename'])));
   }
Index: domain_content/domain_content.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/domain/domain_content/domain_content.module,v
retrieving revision 1.23
diff -u -r1.23 domain_content.module
--- domain_content/domain_content.module	21 Oct 2008 13:28:58 -0000	1.23
+++ domain_content/domain_content.module	21 Nov 2008 03:50:15 -0000
@@ -32,26 +32,22 @@
   $items['admin/domain/content/all'] = array(
     'title' => 'Content for all affiliate sites',
     'page callback' => 'domain_content_view',
-    'page arguments' => array(NULL, TRUE),
+    'page arguments' => array('-1', TRUE),
     'access callback' => 'domain_content_menu_check',
     'file' => 'domain_content.admin.inc',
     'description' => 'View content assigned to all affiliate sites.'. $extra,
     'weight' => -10
   );
-  // Generate the list of active domains as menu items
-  $domains = domain_domains();
-  foreach ($domains as $domain) {
-    $items['admin/domain/content/'. filter_xss_admin($domain['subdomain'])] = array(
-      'title' => filter_xss_admin($domain['subdomain']) .' content',
-      'page callback' => 'domain_content_view',
-      'page arguments' => array($domain['domain_id'], FALSE),
-      'access callback' => 'domain_content_check',
-      'access arguments' => array($domain),
-      'file' => 'domain_content.admin.inc',
-      'description' => 'View content assigned to '. filter_xss_admin($domain['subdomain']),
-      'weight' => $domain['domain_id']
-    );
-  }
+  $items['admin/domain/content/%domain'] = array(
+    'title' => filter_xss_admin($domain['subdomain']) .' content',
+    'page callback' => 'domain_content_view',
+    'page arguments' => array(3, FALSE),
+    'access callback' => 'domain_content_check',
+    'access arguments' => array(3),
+    'file' => 'domain_content.admin.inc',
+    'description' => 'View content assigned to '. filter_xss_admin($domain['subdomain']),
+    'weight' => $domain['domain_id']
+  );
   return $items;
 }
 

