Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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) : '';
Comment | File | Size | Author |
---|---|---|---|
#7 | 1668454-7.patch | 1003 bytes | Nick_vh |
#1 | 1668454-1.patch | 676 bytes | killua99 |
Comments
Comment #1
killua99 CreditAttribution: killua99 commentedThis is a fix for my case, but need review to see if it correct.
Comment #2
Nick_vhCould 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
Comment #3
pwolanin CreditAttribution: pwolanin commentedI 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?
Comment #4
pwolanin CreditAttribution: pwolanin commentedcommitting the patch in #1 above since this is an annoying bug, but I think we need to revisit for a more robust solution.
Comment #5
killua99 CreditAttribution: killua99 commentedAnd this commit is under my name? ^_^ just to know.
Actually I'll try to dig in and see if this is right? solution.
Comment #6
Nick_vhpostponed until we decide to revisit this or until someone wants to take a crack to this problem
Comment #7
Nick_vhRevisited 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.
Comment #8
Nick_vhComment #9
Nick_vhClosing to clean the issue queue a bit