Select the search type
  • Site
  • Web
Search
You are here:  Company/News

Blog2mind

Repairing a DNN 5.1.2 installation that’s missing the default language

There are just some days when things unexpectedly crash, and you have no clue why. This time I installed a brand new DNN 05.01.02 and could not save the Site Settings. The message: “language cannot be null” was clear enough. But when I went down the languages dropdown … it was empty. Seconds later I was in my SQL Mgt Studio trying to figure out if it was related to data, and it sure was. No languages had been installed at all in fact. Turns out this is a known issue, but Joe’s workaround didn’t work for me. So I wrote the following bit of SQL to save the installation. Note it assumes you’re on a failed installation with just a single portal (Portal 0). If not you might need to tweak the last statement a bit.

IF NOT EXISTS (SELECT * FROM {databaseOwner}[{objectQualifier}Packages] WHERE [Name] = 'DefaultLanguage')
INSERT INTO {databaseOwner}[{objectQualifier}Packages]
           ([PortalID]
           ,[Name]
           ,[FriendlyName]
           ,[Description]
           ,[PackageType]
           ,[Version]
           ,[License]
           ,[Manifest]
           ,[Owner]
           ,[Organization]
           ,[Url]
           ,[Email]
           ,[ReleaseNotes]
           ,[IsSystemPackage]
           ,[CreatedByUserID]
           ,[CreatedOnDate]
           ,[LastModifiedByUserID]
           ,[LastModifiedOnDate])
     VALUES
(0,
N'DefaultLanguage', 
N'Default Language', 
N'The US Language Pack is included as the default language with DotNetNuke.', 
N'CoreLanguagePack', 
'1.0.0',
N'DotNetNuke® - http://www.dotnetnuke.com
Copyright (c) 2002-2008
by DotNetNuke Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.', NULL, N'DotNetNuke', N'DotNetNuke Corporation', 'www.dotnetnuke.com', 'support@dotnetnuke.com', N'There are no release notes for this version.', 1, -1, GETDATE(), -1, GETDATE()); GO IF NOT EXISTS (SELECT * FROM {databaseOwner}[{objectQualifier}Languages] WHERE [CultureCode]='en-US') INSERT INTO {databaseOwner}[{objectQualifier}Languages] ([CultureCode] ,[CultureName] ,[FallbackCulture] ,[CreatedByUserID] ,[CreatedOnDate] ,[LastModifiedByUserID] ,[LastModifiedOnDate]) VALUES ('en-US', 'English (United States)', NULL, -1, GETDATE(), -1, GETDATE()) GO INSERT INTO {databaseOwner}[{objectQualifier}LanguagePacks] ([PackageID] ,[DependentPackageID] ,[LanguageID] ,[CreatedByUserID] ,[CreatedOnDate] ,[LastModifiedByUserID] ,[LastModifiedOnDate]) SELECT PackageId, -2, 1, -1, GETDATE(), -1, GETDATE() FROM {databaseOwner}[{objectQualifier}Packages] WHERE [Name] = 'DefaultLanguage' GO INSERT INTO {databaseOwner}[{objectQualifier}PortalLanguages] ([PortalID], [LanguageID], [CreatedByUserID], [CreatedOnDate], [LastModifiedByUserID], [LastModifiedOnDate]) SELECT 0, LanguageID, -1, GETDATE(), -1, GETDATE() FROM {databaseOwner}[{objectQualifier}Languages] WHERE [CultureCode]='en-US' GO

Archive