Hi, i was having problems when i submit a keyword to search on the normal block search, i am using i18n prefix, the problem was that the prefix goes twice, i did a fast fix on apachesolr_search.module , function apachesolr_search_search_box_form_submit, adding this to line 826

if (!empty($language->language) && preg_match('/^\/' . $language->prefix . '\/?/', $path) > 0) {
$path = preg_replace('/^\/' . $language->prefix . '\/?/', '/', $path);
}

Comments

tim_dj’s picture

I am having the same problem. Your fix works but you forgot to add:

global $language;

so total code is:

  global $language;
  if (!empty($language->language) && preg_match('/^\/' . $language->prefix . '\/?/', $path) > 0) {
    $path = preg_replace('/^\/' . $language->prefix . '\/?/', '/', $path);
  }

add this at line 828 in latest dev version.

There must be a cleaner solution but I am glad it's fixed for now!

nick_vh’s picture

Status: Active » Needs work

This seems a little similar to the base path issue.

Can you rewrite this code to be more similar to the following snippet?

$path = $form['#action'];
  // Create a regular expression string to find the base_path at the beginning
  // of the string.
  $base_path_regex = '#^' . base_path() . '#';
  // Find the base_path in the path()
  if (preg_match($base_path_regex, $path)) {
    // Replace the beginning of the string with nothing. The regular expression
    // avoids that we replace too much
    $path = preg_replace($base_path_regex, '', $path);
  }
toemaz’s picture

Bumped into the same issue. Applied #1 with success. However, I'm not enough into the code to create a nicer solution as Nick requested. Sorry man :) If someone has a patch to test, count me in for testing.

hitfactory’s picture

Issue summary: View changes
StatusFileSize
new1.57 KB

Here's a first stab at a patch.

mkalkbrenner’s picture

Patch from #4 seems incorrect to me. I think the order is base_path/language_prefix/...

hitfactory’s picture

Take two...

mkalkbrenner’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.