With i18n-module activated it produces double language prefixes like '/en/en/search/content/test'. Though the module's code is pretty much simple and straightforward, I couldn't solve this issue by myself. Anyone can offer a solution and submit a patch?

Comments

cornelia’s picture

This is working for me:

function custom_search_path_form_alter(&$form, $form_state, $form_id) {
    if ($form_id == 'search_form') {
        $solr_search_urlprefix = substr(url('search/apachesolr_search/'),1);

        if( strpos( $_REQUEST['q'], $solr_search_urlprefix ) !== false ) {
            $goto = str_replace($solr_search_urlprefix, 'search/content/', $_REQUEST['q']);
            drupal_goto($goto);
            exit;
        }
    }
}

Cheers
Conni

yngens’s picture

Status: Active » Closed (fixed)

Thanks Cornelia, I've finally committed your code. Please, everybody, use custom_search_path 6.x-2.3

yngens’s picture

Issue summary: View changes

Deleted the module's code