Written by: Peter Donker Sat, 12 Sep 2009 19:16:03 GMT
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
7 comment(s) so far...
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 steps1. Goto Admin-->Languages2. 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" box5. Click update That was it. That solved my issue.
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 steps1. Goto Admin-->Languages2. 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" box5. Click update That was it. That solved my issue.
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.
@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.
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!
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!
Re: Repairing a DNN 5.1.2 installation that’s missing the default language @doggiedaddy1: Indeed the last statement includes a portalID.
@doggiedaddy1: Indeed the last statement includes a portalID.
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.comIF NOT EXISTS [edit: stuff cut]
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.comIF NOT EXISTS [edit: stuff cut]
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
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
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
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
Please note we are located in Europe. Business hours are between 9 AM and 6 PM local time (Central European Time) which corresponds to 3 AM and noon EST.