the _search_restrict_advanced_form() function has a bug, with "empty" search_restrict_content_type variable
empty like:

array('page' => array(1=> 0, 2=>0, 3=>0))

the page content type will not be available in advanced_search

this case is correctly handled in _search_restrict_excluded_content_types() so it should be used like:

function _search_restrict_advanced_form($form, &$form_state) {
  global $user;

  if ($user->uid == 1) {
    return $form;
  }

  foreach (_search_restrict_excluded_content_types() as $type) {
    unset($form['advanced']['type']['#options'][$type]);
    unset($form['advanced']['type'][$type]);
  }
  return $form;
}

another improvement: I would remove condition user=1, because in D7 the admin role should be used for such cases..

Comments

jonathan_hunt’s picture

Patch incorporating the code above is at https://drupal.org/node/1293472#comment-5793230