SearchBox changed in October Cumulative Update
The problem
With the introduction of the October Cumulative Update for SharePoint 2007 I encountered a problem with the search box on multilingual sites. After the installation of the update the scopes dropdown list always uses the same scope display group. After investigation I found that the language of the root web is used to determine the scope display group.
The cause
This behavior was not present in the control prior to the October update, in the description of the update (KB975731) we found:
"All sites," "People," and "This site" search scopes are available only for English language sites. Sites that are written in other languages show only the "This site" search scope.
This explains that the control has been changed in this update.
The reason
Before the October Update the property ScopeDisplayGroupName is set in the constructor of the SearchBoxEx control:
this._ScopeDisplayGroupName =
SearchCommon.GetLocResourceString(
LocStringId.ScopeDisplayGroup_SearchDropdown_Name);
In the October Update this line of code has been changed to:
this._ScopeDisplayGroupName = GetScopeDisplayGroupNameDefaultValue();
This function uses the language from the root web is to determine the value for the ScopeDisplayGroupName property:
private static string GetScopeDisplayGroupNameDefaultValue() { if (SPContext.Current != null) { while (SPContext.Current.Site != null) { CultureInfo siteCollectionCulture = null; SPSecurity.RunWithElevatedPrivileges(delegate { siteCollectionCulture = new CultureInfo( (int) SPContext.Current.Site.RootWeb.Language); }); return StringResourceManager.GetString( LocStringId.ScopeDisplayGroup_SearchDropdown_Name, siteCollectionCulture); } } return SearchCommon.GetLocResourceString( LocStringId.ScopeDisplayGroup_SearchDropdown_Name); }
The solution
For this website I want the value for the ScopeDisplayGroupName property to be based on the culture of the current web. To re-enable this functionality we updated our custom master page and added the following to the SearchBoxEx control:
<sharepoint:searchboxex runat="server" ... ScopeDisplayGroupName="<%$Resources:searchfix,ScopeDisplayGroup_SearchDropdown_Name%>" />
In the App_GlobalResources I added custom resource files with the correct translations for the resource key ScopeDisplayGroup_SearchDropdown_Name.

