How To Fixing PortalSettings issue on multilingual Websites in DNN 7.3.2

Today I will share about How to fixing issue on multilingual website in DNN 7.3.2.
DNN 7.3.2 enhanced the stored procedure for saving Site Settings to add multilanguage support, unfortunately it missed to include proper handling of language specific settings within the business layer and some other aspects. As effect, DNN 7.3.2 fails to load site settings for multilingual sites and renders an error message.
I created a full solution to add localization support for website settings, which is scheduled to be included with DNN 7.4.0, meanwhile you may run the script below from Host > SQL, in order to fix this issue.

"NOTE: DO NOT APPLY TO DNN 7.4.0 OR LATER"

This fix is also included in TurboDNN 0.9.3 ff. - the solution to improve database performance of DNN, which might be downloaded for free from here. (Please take the time to read instructions enclosed.)

-- ensure, last modified is not Null (should not exist)
UPDATE {databaseOwner}[{objectQualifier}PortalSettings]
 SET   LastModifiedOnDate = '2000-01-01'
 WHERE LastModifiedOnDate is Null
GO
IF OBJECT_ID(N'{databaseOwner}[{objectQualifier}GetPortalSetting]', N'P') IS NOT NULL
    DROP PROCEDURE {databaseOwner}[{objectQualifier}GetPortalSetting]
GO
CREATE PROCEDURE {databaseOwner}[{objectQualifier}GetPortalSetting]
    @PortalID    Int,     -- Not Null
    @SettingName nVarChar(50), -- Not Null
    @CultureCode nVarChar(50) -- not Null
AS
BEGIN
 SELECT TOP (1)
 SettingName,
 CASE WHEN Lower(SettingValue) Like 'fileid=%'
 THEN {databaseOwner}[{objectQualifier}FilePath](SettingValue)
 ELSE SettingValue
 END   AS SettingValue,
 CreatedByUserID,
 CreatedOnDate,
 LastModifiedByUserID,
 LastModifiedOnDate,
 CultureCode
 FROM  {databaseOwner}[{objectQualifier}PortalSettings]
 WHERE PortalID    = @PortalID
   AND SettingName = @SettingName
 ORDER BY LastModifiedOnDate DESC
END
GO
IF OBJECT_ID(N'{databaseOwner}[{objectQualifier}GetPortalSettings]', N'P') IS NOT NULL
    DROP PROCEDURE {databaseOwner}[{objectQualifier}GetPortalSettings]
GO
CREATE PROCEDURE {databaseOwner}[{objectQualifier}GetPortalSettings]
    @PortalId    Int,            -- not Null!
    @CultureCode nVarChar(20)    -- not Null!
AS
BEGIN
 SELECT
 SettingName,
 CASE WHEN Lower(SettingValue) Like 'fileid=%'
 THEN {databaseOwner}[{objectQualifier}FilePath](SettingValue)
 ELSE SettingValue
 END   AS SettingValue,
 CreatedByUserID,
 CreatedOnDate,
 LastModifiedByUserID,
 LastModifiedOnDate,
 CultureCode
 FROM  {databaseOwner}[{objectQualifier}PortalSettings] P
 JOIN  (SELECT PortalID, SettingName SN, Max(LastModifiedOnDate) MD
        FROM {databaseOwner}[{objectQualifier}PortalSettings]
 WHERE PortalID = @PortalId
 GROUP BY PortalID, SettingName) S
   ON P.PortalID = S.PortalID AND P.SettingName = S.SN AND P.LastModifiedOnDate = S.MD;
END
GO

UPDATE: this fix has been included with DNN 7.3.4, you shouldn't need it, if you upgraded to 7.3.4 and don't apply it to DNN 7.4.0 or later.