Index: search_by_page.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/search_by_page/search_by_page.module,v
retrieving revision 1.1.2.34
diff -u -r1.1.2.34 search_by_page.module
--- search_by_page.module	17 Aug 2010 23:06:03 -0000	1.1.2.34
+++ search_by_page.module	9 Nov 2010 23:22:23 -0000
@@ -524,14 +524,19 @@
           '%path' => $item->page_path),
         WATCHDOG_NOTICE);
 
-      _search_by_page_remove_path($item->pid);
+      // Remove content from the search index, but mark it as indexed
+      // in the SBP database, so it doesn't hold up other pages in the next
+      // cron run.
+      _search_by_page_remove_searchinfo($item->pid);
+      _search_by_page_update_last_time($item->pid, time());
+
       continue;
     }
 
     // Check for module override of content.
     $content = $info['content'];
-    // If module didn't return content, render the page to get content.
-    if (!$content) {
+    if (!isset($info['content'])) {
+      // Mode didn't return content. Render the page to get it.
       // Separate path into main part and query.
       $parts = search_by_page_path_parts($item->page_path);
       $path = drupal_get_normal_path($parts[0]);
@@ -546,8 +551,14 @@
       $_GET = $save_get;
     }
 
+    if (!isset($content)) {
+      $content = 0;
+    }
+
     // $content will be either a string or an error code, if rendered.
-    if ($content && !is_int($content)) {
+    // Note that an empty string is acceptable for content -- it could just
+    // be a page with nothing on it except the title.
+    if (!is_int($content)) {
       if ($info['title']) {
         $content = '<h1>' . $info['title'] . '</h1> ' . $content;
       }
@@ -562,11 +573,18 @@
       if (isset($reasons[$con])) {
         $con = $reasons[$con];
       }
-      // Remove this page from the search index, in most cases.
-      if ($content != MENU_SITE_OFFLINE) {
-        _search_by_page_remove_searchinfo($item->pid);
+
+      // If the site was off-line, abort the cron run
+      if ($content == MENU_SITE_OFFLINE) {
+        break;
       }
 
+      // Remove content from the search index, but mark it as indexed
+      // in the SBP database, so it doesn't hold up other pages in the next
+      // cron run.
+      _search_by_page_remove_searchinfo($item->pid);
+      _search_by_page_update_last_time($item->pid, time());
+
       watchdog('search_by_page', 'Content not rendered (%con) - PID (%pid), path (%path), realpath (%real), language (%lang)',
         array(
           '%pid' => $item->pid,
Index: sbp_attach.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/search_by_page/sbp_attach.module,v
retrieving revision 1.1.2.15
diff -u -r1.1.2.15 sbp_attach.module
--- sbp_attach.module	17 Aug 2010 23:06:03 -0000	1.1.2.15
+++ sbp_attach.module	9 Nov 2010 23:22:23 -0000
@@ -354,10 +354,17 @@
   }
   $node = node_load($nid, NULL, TRUE);
   $fileinfo = pathinfo($fname);
-  $ret = array();
 
-  // We need to construct a "title" for this entry, no matter what.
+  $fullpath = file_create_path($fname);
+  if (!$fullpath || !is_file($fullpath)) {
+    // File was not in an acceptable location or doesn't exist.
+    return NULL;
+  }
+
+  // Construct the information for this file.
+  $ret = array();
 
+  // Title.
   $use_desc = search_by_page_setting_get('sbp_attach_use_description', $environment, 0);
   $prepend_node_title = search_by_page_setting_get('sbp_attach_prepend_node_title', $environment, 0);
 
@@ -373,19 +380,17 @@
   }
   $ret['title'] = check_plain($ret['title']);
 
+  // Set the content to an empty string, in case we cannot extract it.
+  // In this case, we'll just return the title we've constructed.
+  $ret['content'] = '';
+
   // Extract file content, using helper function
   $helpers = search_files_get_helpers();
 
   $help = $helpers[ $fileinfo['extension'] ];
   if (!$help) {
     // no text extraction function for this file extension defined
-    return NULL;
-  }
-
-  $fullpath = file_create_path($fname);
-  if (!$fullpath || !is_file($fullpath)) {
-    // file was not in an acceptable location or doesn't exist
-    return NULL;
+    return $ret;
   }
 
   $quoted_file_path = '"'. escapeshellcmd($fullpath) .'"';
@@ -393,7 +398,7 @@
   $content = search_files_convert_to_utf8(shell_exec($helper_command));
   if (!$content) {
     // no text in file
-    return NULL;
+    return $ret;
   }
 
   if (!$keys) {
