Overview
The Site Settings can fail to load if the environment if the site is in a localized environment. The specific portal may not support the locale that is selected for the environment.
Prerequisites
- Access to SQL Server
- Access to a SuperUser account
Diagnosis
The error generated in the SiteRoot/Portals/_default/Logs folder while navigating to the Settings > Site Settings is:
Failed to load resource: the server responded with a status of 400 (Bad Request)
API/PersonaBar/SiteSettings/GetPortalSettings?portalId=undefined&cultureCode=:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
Accessing the network request that was failing and viewing the response in the developer tools by pressing F12 and clicking the network tab, shows:
{"Message": "Current site does not support this locale (en-US)."}
This error is due to the Portal not having the specific Locale/Language. In this case, it appears that the PortalLocalization table has the correct culture code (en-US). However, the PortalLanguages table does not have the respective pair for the Portal ID / Locale.
Solution
To resolve this error, follow the steps below:
-
Locate the Portal ID of one of the sites with this issue. You can find this PortalID by going into Manage > Sites > List View > Site ID.
-
Then execute the following queries from the Settings > SQL Console menu in the Persona Bar or using SSMS.
The query below will list theCultureCode
used for the Portal and the Language ID for thisCultureCode
. Since the error mentions 'en-US', the LanguageID is expected to be '1'. You can confirm the LanguageID by running SELECT * FROM Languages in the SQL Console.
SELECT PortalID,
PortalName,
pl.CultureCode,
LanguageID
FROM PortalLocalization pl
JOIN Languages l ON pl.CultureCode = l.CultureCode
WHERE PortalID = X --replace the X with the Portal ID - Once the language(s) used by the Portal have been identified, next, we will execute the query below to find out if the language(s) are bound to the Portal.
SELECT PortalID,
LanguageID
FROM PortalLanguages
WHERE PortalID = X --replace the X with the Portal ID - If the above query does not return an entry matching the PortalID/LanguageID for the Portal with this issue, then the solution would be to insert the missing language manually. We can add the language to the Portal using the below query.
As a best practice, make sure to create a backup of the database before proceeding.Note: In the query below, make sure to replace PortalID and LanguageID with the corresponding values.EXEC AddPortalLanguage PortalID, LanguageID, 1, 1
- The last step is to clear the Application Cache to load the new settings from the database. To clear the cache, go to the Settings > Servers menu and click on the Clear Cache button.
Testing
You can test that this issue has been resolved by:
- Go into Settings > Site Settings
- The Site Settings should now load without any issues.
Comments
0 comments
Please sign in to leave a comment.