Hi. I'm developing a site with two languages where one language is currently disabled. This causes search path to change from eg. /en/search to simply /search. However custom_search puts language prefix even though it is not needed. I took the time and fixed it. Not 100% sure if this is the way to do it but I haven't encountered any problems so far.

Change line no.# 389 in custom_search.module from:
$base_redirect = $GLOBALS['base_url'] . '/' . $GLOBALS['language']->prefix;
to:

  $languages = language_list('enabled');
  $languages = $languages[1];
  $base_redirect = $GLOBALS['base_url'] . '/';
  if (count($languages) > 1) $base_redirect .= $GLOBALS['language']->prefix;

Cheers.

Comments

jdanthinne’s picture

Status: Needs review » Fixed

You're right, thanks!
Pushed to dev.

metalinspired’s picture

Glad I could help. Cheers.

Status: Fixed » Closed (fixed)

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