Blog2mind

Sep 12

Written by: Peter Donker
Sat, 12 Sep 2009 19:16:03 GMT  RssIcon

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. Here is a fix.

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

Tags:
Categories:
Location: Blogs Parent Separator Blog2mind

7 comment(s) so far...


Gravatar

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

I experienced the same issue, but mine was a simple fix.

Here are my steps

1. Goto Admin-->Languages
2. Once on the languages page, you will notice the Languages dropdown to be completely empty. (This dropdown is located under "available locales".) Click "Edit Languages" link under this dropdown.

3. Select "English US" (Or any other language) as your language.
4. Be sure to check the "Enabled" box
5. Click update


That was it. That solved my issue.

By Mohammed Imaduddin on   Mon, 14 Sep 2009 13:59:53 GMT
Gravatar

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

@Mohammed: that's what I referred to as 'Joe's fix', but this won't help if the package is not actually installed, because then the dropdown on step 3 remains empty as well.

By Peter Donker on   Mon, 14 Sep 2009 14:01:16 GMT
Gravatar

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

Yep, "Joe's Fix" didn't work for me either. I tried the "Joe's Fix" and it gave back errors as well, but the second time, even after the error, it did make the default language (english) available for the host portal. Selected it and problem gone with the host portal. However, can't resolve it with the other 3 portals for love or money. I think this is the solution. You said that for multiple portals, to tweak the last sql statement, I'm presuming that you mean from the last "Select" on? Line 100 is the portal number? If so, I would run it once for each portal changing the portal number? Or rewrite it to run for all portals?

I had 5 different languages installed on these portals (it is my test install, so not losing anything production here). None of them are now enabled, nor can I enable them. Only the default is enabled now.

Only thing I can say for sure is that I don't care how "critical" this update is, I'll wait on my production for 5.1.3 and this issue to go away!

By doggiedaddy1 on   Tue, 15 Sep 2009 08:39:11 GMT
Gravatar

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

@doggiedaddy1: Indeed the last statement includes a portalID.

By Peter Donker on   Tue, 15 Sep 2009 08:39:37 GMT
Gravatar

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

Hello Peter,Thanks much for the SQL code. It fixed my brand new DNN 5.1.2 site error. The only slowdown was that when I copied and pasted the sql script it included the line numbers. In case this helps anyone else, I've pasted my version of the code below, minus the database owner clauses and with 'objectqualifier' replaced with dnn_.
Thanks,
David Schlesinger www.arete-erp.com

IF
NOT EXISTS [edit: stuff cut]

By david on   Wed, 23 Sep 2009 08:39:07 GMT
Gravatar

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

Hi David,

At the top of the code block there is a 'copy to clipboard' button (hover over the text to see it). It is part of the Javascript code highlighter I use.

You don't need to remove the {databaseOwner} or {objectqualifier} blocks. They are replaced automatically when you use Host > SQL and select 'Run As Script'. And replacing it with dnn_ for a distributed script won't do much good as dnn_ is not a default object qualifier. It is your specific object qualifier. So the script would no longer run for most others (except those that chose dnn_ by chance).

Peter

By Peter Donker on   Wed, 23 Sep 2009 08:43:30 GMT
Gravatar

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

Hi Peter,

I didn't see the copy to clipboard functionality! That would have saved me a bit.. lol.

I am in the habit of using SQL Server Management Console. I am somewhat new to DNN; I haven't used the SQL module. I checked it out just now. It looks like I have been missing some powerful functionality.

Thanks for your help!

David


By david on   Thu, 24 Sep 2009 12:41:30 GMT