--- search_block.module.bak 2008-12-21 23:32:25.000000000 +0100 +++ search_block.module 2008-12-21 23:47:31.000000000 +0100 @@ -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,9 @@ $type = $form['old_type']['#value']; } + 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 +140,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.'), ); } @@ -321,4 +323,4 @@ // Update index search_index($node->nid, 'node', $text); -} \ No newline at end of file +}