In our site the block_search is redirecting bad cause the path is incomplete cleaned. For example:

We got example.com/mydrupal as base path drupal installation, then our "core search" is "search/apachesolr_search" the result for a normal search will be:

exmaple.com/mydrupal/search/apachesolr_search/

But it's not our case. The redirect it's doing a wrong path,

exmaple.com/mydrupal/mydrupal/search/apachesolr_search/.

This happen because for our site the "base_path" it's not "/" is "/mydrupal/".

I figure out that some fix can be recodding this line.

($path{0} == "/" ) ? $path = substr($path, 1) : '';

CommentFileSizeAuthor
#7 1668454-7.patch1003 bytesNick_vh
#1 1668454-1.patch676 byteskillua99
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killua99’s picture

Status: Active » Needs review
FileSize
676 bytes

This is a fix for my case, but need review to see if it correct.

Nick_vh’s picture

Status: Needs review » Needs work

Could you write down a small tutorial how we can replicate this? I'd like to add some simpletests for this case as it is a sensitive thing

pwolanin’s picture

I don't think you can have a test install in a subdir?

Also, our function looks rather different from: http://api.drupal.org/api/drupal/modules%21search%21search.module/functi...

maybe worth digging into what's going on in more depth?

pwolanin’s picture

Status: Needs work » Active

committing the patch in #1 above since this is an annoying bug, but I think we need to revisit for a more robust solution.

killua99’s picture

And this commit is under my name? ^_^ just to know.

Actually I'll try to dig in and see if this is right? solution.

Nick_vh’s picture

Status: Active » Postponed

postponed until we decide to revisit this or until someone wants to take a crack to this problem

Nick_vh’s picture

FileSize
1003 bytes

Revisited this a little bit and added some more commenting to make it clear what it does exactly. Committing and closing this issue. I think the approach you chose was quite ok. I could rewrite it to be less cryptic but I don't see why.

Nick_vh’s picture

Status: Postponed » Fixed
Nick_vh’s picture

Status: Fixed » Closed (fixed)

Closing to clean the issue queue a bit