In menu.inc:

  for ($i = 0; $i < $router_item['number_parts']; $i++) {
    if ($link_map[$i] == '%') {
      $link_map[$i] = $path_map[$i];
    }

when you have no search term, this tries to iterate 3x, but %map only has 2 values:

Array
(
    [0] => search
    [1] => site
)

because $router_item['number_parts'] = 3, not 2...

Comments

nick_vh’s picture

Status: Active » Postponed (maintainer needs more info)

Please give us more context specific information. What is the configuration of your search page, special cases, ....

stephenrobinson’s picture

I went to /admin/config/search/apachesolr/search-pages/add and added User ID's, perhaps the path needs to be 3 tokens? In my case I will generate an invisible node-user-profile content type (with a goto user account on view content type), node out of user+profile info for the search index, like what I did with D6, as this lists all contents and users at the same time, which is what my customers like, so am not going to be using this feature anyway...

nick_vh’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Can't reproduce. Apologies

nnevill’s picture

in my case removing "%" placeholder in all solr pages was helpful

netsensei’s picture

Version: 7.x-1.0-beta11 » 7.x-1.0-rc2
Status: Closed (cannot reproduce) » Active

Hello,

We're still encountering this bug. We're using Drupal 7.12 + solr 1.0-rc2 of the module. We've created a basic search page with a single facet and it returns this error:

Notice: Undefined offset: 1 in _menu_translate() (regel 776 van /Users/matthias/krimson/krimson_cancer/www/includes/menu.inc).

I believe it has something do with the patch in http://nickveenhof.be/blog/lets-talk-apache-solr-clean-urls and #1108314: Undefined offset: 2 in _menu_translate

When I put lines 164 - 174 in apachesolr_search.module in comment, the issue disappears after a cache clear.

    // Not using menu tail because of inflexibility with clean urls
    $items[$search_page['search_path'] . '/%'] = array(
      'title' => $page_title,
      'load arguments' => array('%map', '%index'),
      'page callback' => 'apachesolr_search_custom_page',
      'page arguments' => array($search_page['page_id'], $keys_pos, $position),
      'access arguments' => array('search content'),
      'type' => ($taxonomy_search) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
      'file' => 'apachesolr_search.pages.inc',
      'file path' => drupal_get_path('module', 'apachesolr_search'),
    );
nick_vh’s picture

what if you remove the 'load arguments' => array('%map', '%index'), from the array? They've become useless now

swentel’s picture

I can confirm. It doesn't make sense to have two menu router items, especially one with a wildcard. It's always the second one that's going to be found anyway.

Come to our office if you want to find out :p

nick_vh’s picture

not always, what if you have a path without a search key?

nick_vh’s picture

Status: Active » Closed (duplicate)
nick_vh’s picture

Issue summary: View changes

typo