Index: search_block.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/search_block/search_block.module,v
retrieving revision 1.1.4.5.2.2
diff -u -r1.1.4.5.2.2 search_block.module
--- search_block.module	6 Aug 2008 00:58:48 -0000	1.1.4.5.2.2
+++ search_block.module	28 Dec 2008 03:53:41 -0000
@@ -43,7 +43,7 @@
  * Implementation of hook_form()
  */
 function search_block_restrict_form() {
-  $types = node_get_types($op = 'types', $node);
+  $types = node_get_types($op = 'types');
 
   foreach ($types as $key => $array) {
     $enabled = variable_get('search_block_'. $key, FALSE);
@@ -105,7 +105,12 @@
     $type = $form['old_type']['#value'];
   }
   
-  $enabled = variable_get('search_block_'. $type, FALSE);
+  if (!empty($type)) {
+    $enabled = variable_get('search_block_'. $type, FALSE);
+  }
+  else {
+    $type = 'search_block_type_not_defined';
+  }
 
   switch ($form_id) {
     case 'node_type_form':
@@ -138,7 +143,7 @@
           $form['search_block_set']['search_block'] = array(
             '#type' => 'checkbox',
             '#title' => t('Restrict this node from the search index'),
-            '#default_value' => $form['#node']->search_block,
+            '#default_value' => isset($form['#node']->search_block) ? $form['#node']->search_block : 0,
             '#description' => t('Enable this option to hide this node from the search index.'),
           );
         }
@@ -155,9 +160,9 @@
       
     case 'search_form':
       if (empty($form['advanced']['type']['#options'])) break;
-      foreach ($form['advanced']['type']['#options'] as $type2 => $name) {
-        if (variable_get('search_block_'. $type2, FALSE)) {
-          unset($form['advanced']['type']['#options'][$type2]);
+      foreach ($form['advanced']['type']['#options'] as $node_type => $name) {
+        if (variable_get('search_block_'. $node_type, FALSE)) {
+          unset($form['advanced']['type']['#options'][$node_type]);
         }
       }
       break;
