Blocks not picking up branch when viewing search results
Migrated issue
Reported by: jhodgdon
The Search block in the API module normally switches so that a search by default is searching within whatever branch/tab of whatever project you are currently looking at. E.g. if I am viewing a D7 function, file, topic, etc., the search says "Search Drupal 7", and when I do a search, it shows me results with the D7 tab activated. That's all good.
Now, do this.
a) Click on a non-default branch or project, such as Drupal 6 in my test site. The search box switches to that project/branch. So far, so good.
b) Do a search. Results are shown for that project/branch. So far, so good. However, the Search block shows "Search Drupal 7", which is not good.
c) Click on one of the other search tabs. Results are shown for that project/branch, which is good. However, the search box isn't switching.
It shouldn't be difficult to add some logic to the block so that it will notice that a URL like
(site)/api/search/D6/db_list
as well as a URL like
(site)/api/drupaldb/path.inc/function/arg/D6
both mean that I am on the D6 branch.
Note that in these URLs, my project is called "drupaldb" and my branch is called "D6". The project is not part of the search URL, just the branch.