· Chris Hammond
Last Updated
After upgrading to DNN 7.1.2 Site Settings doesn't work
Troubleshoot problems encountered while upgrading websites to DNN 7.1.2. Post guides through issues related to SQL errors and DNN Inline Edit functionality.
I upgraded a number of websites to DNN 7.1.2 tonight, and I ran into two different problems, this blog post will hopefully help you address the issues that I ran into, if you happen to run into them as well.
Disclaimer: Always backup your website/database before making any changes or running any SQL scripts you got off the web. I don't take any responsibility for damage you cause to your own website, but if you need consulting help with your DNN site, I am available.
Problem #1
During the upgrade process on 2 of 10 installs I upgraded tonight, the 07.01.02.sqldataprovider file had an error, the error gets logged into the Providers\DataProviders\SqlDataProvider folder in the 07.01.02.log.resources file. The error is
System.Data.SqlClient.SqlException (0x80131904): Ambiguous column name 'ModuleId'.at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout)at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script)ClientConnectionId:cc490fb3-5518-4ff4-bd9a-6e6aa00ca0d7CREATE PROCEDURE dbo.[GetRecycleModules]@PortalID int
AS
SELECT OwnerPortalID, PortalID, vw_Modules.TabID, vw_Modules.TabModuleID,
vw_Modules.ModuleID, ModuleDefID, vw_Modules.ModuleOrder, vw_Modules.PaneName, vw_Modules.ModuleTitle,vw_Modules.CacheTime, vw_Modules.CacheMethod, vw_Modules.Alignment, vw_Modules.Color, vw_Modules.Border,vw_Modules.IconFile, AllTabs, vw_Modules.Visibility, vw_Modules.IsDeleted, vw_Modules.Header,vw_Modules.Footer, StartDate, EndDate, vw_Modules.ContainerSrc, vw_Modules.DisplayTitle,vw_Modules.DisplayPrint, vw_Modules.DisplaySyndicate, vw_Modules.IsWebSlice, vw_Modules.WebSliceTitle,vw_Modules.WebSliceExpiryDate, vw_Modules.WebSliceTTL, InheritViewPermissions, IsShareable,IsShareableViewOnly, DesktopModuleID, DefaultCacheTime, ModuleControlID,BusinessControllerClass, IsAdmin, SupportedFeatures, ContentItemID,[Content], ContentTypeID, ContentKey, Indexed, StateID,vw_Modules.CreatedByUserID, vw_Modules.CreatedOnDate, LastContentModifiedOnDate, vw_Modules.UniqueId,vw_Modules.VersionGuid, vw_Modules.DefaultLanguageGuid, vw_Modules.LocalizedVersionGuid, vw_Modules.CultureCode,TabModules.LastModifiedByUserID, TabModules.LastModifiedOnDateFROM vw_Modules INNER JOINTabModules ON vw_Modules.TabModuleID = TabModules.TabModuleID
WHERE PortalId = @PortalID
ORDER BY ModuleId
Which in laymen's terms, is that the "order by ModuleId" conflicts because SQL doesn't know which ModuleId to use. This is a fairly easy fix, you can run the following SQL in your favorite SQL query tool, or even the Host/SQL page of your DNN site. (if you are using a custom databaseOwner or objectQualifier in your web.config file, but sure to modify this SQL to match your database)
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'dbo.[GetRecycleModules]') AND OBJECTPROPERTY(id, N'IsPROCEDURE') = 1)
DROP PROCEDURE dbo.[GetRecycleModules]
GO
CREATE PROCEDURE dbo.[GetRecycleModules]
@PortalID int
AS
SELECT OwnerPortalID, PortalID, vw_Modules.TabID, vw_Modules.TabModuleID,
vw_Modules.ModuleID, ModuleDefID, vw_Modules.ModuleOrder, vw_Modules.PaneName, vw_Modules.ModuleTitle,
vw_Modules.CacheTime, vw_Modules.CacheMethod, vw_Modules.Alignment, vw_Modules.Color, vw_Modules.Border,
vw_Modules.IconFile, AllTabs, vw_Modules.Visibility, vw_Modules.IsDeleted, vw_Modules.Header,
vw_Modules.Footer, StartDate, EndDate, vw_Modules.ContainerSrc, vw_Modules.DisplayTitle,
vw_Modules.DisplayPrint, vw_Modules.DisplaySyndicate, vw_Modules.IsWebSlice, vw_Modules.WebSliceTitle,
vw_Modules.WebSliceExpiryDate, vw_Modules.WebSliceTTL, InheritViewPermissions, IsShareable,
IsShareableViewOnly, DesktopModuleID, DefaultCacheTime, ModuleControlID,
BusinessControllerClass, IsAdmin, SupportedFeatures, ContentItemID,
[Content], ContentTypeID, ContentKey, Indexed, StateID,
vw_Modules.CreatedByUserID, vw_Modules.CreatedOnDate, LastContentModifiedOnDate, vw_Modules.UniqueId,
vw_Modules.VersionGuid, vw_Modules.DefaultLanguageGuid, vw_Modules.LocalizedVersionGuid, vw_Modules.CultureCode,
TabModules.LastModifiedByUserID, TabModules.LastModifiedOnDate
FROM vw_Modules INNER JOIN
TabModules ON vw_Modules.TabModuleID = TabModules.TabModuleID
WHERE PortalId = @PortalID
ORDER BY vw_modules.ModuleId
/* update GetPortalsByUser Procedure */
/*************************************/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.[GetPortalsByUser]') AND type in (N'P', N'PC'))
DROP PROCEDURE dbo.[GetPortalsByUser]
GO
CREATE PROCEDURE dbo.[GetPortalsByUser]
@userID int
AS
SELECT dbo.vw_Portals.*
FROM dbo.UserPortals INNER JOIN
dbo.vw_Portals ON
dbo.UserPortals.PortalId = dbo.vw_Portals.PortalID
WHERE (dbo.UserPortals.UserId = @userID)
AND (dbo.vw_Portals.DefaultLanguage = dbo.vw_Portals.CultureCode)
GO
/************************************************************/
/***** SqlDataProvider *****/
/************************************************************/
So that addresses problem #1, fixing the SQL script for DNN 7.1.2 that failed to run successfully.
Problem #2
After working with one of the sites I upgraded, I noticed that there were some mysterious Pencil images showing up, and I quickly realized that DNN now has Inline Edit functionality working again. This hasn't worked since the DNN5 days. I hate the inline edit functionality on any site that "other" people maintain, so I wanted to turn this functionality off. Here is where Problem 2 comes in, to turn off Inline Edit in DNN, you need to go to the Site Settings page under the Admin menu. When I went to the Admin/Site Settings page I was provided with this nice error.
Error: Site Settings is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: c:\SOMEPATHHERE\wwwroot\DesktopModules\Admin\Portals\SiteSettings.ascx.cs(594): error CS1502: The best overloaded method match for 'FriendlyUrlSettings.FriendlyUrlSettings(DotNetNuke.Framework.Providers.Provider)' has some invalid arguments ---> System.Web.HttpCompileException: c:\SOMEPATHHERE\wwwroot\DesktopModules\Admin\Portals\SiteSettings.ascx.cs(594): error CS1502: The best overloaded method match for 'FriendlyUrlSettings.FriendlyUrlSettings(DotNetNuke.Framework.Providers.Provider)' has some invalid arguments at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Modules.WebFormsModuleControlFactory.CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) at DotNetNuke.UI.Modules.ModuleControlFactory.LoadModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---
Isn't that nice and pretty? After doing some soul searching, I was able to track down the cause of the problem, and come up with a solution. The problem comes from the fact that I previously used the Ifinity FriendlyUrl Provider for DNN. Even though I am no longer using it, the DLL for the provider still exists within my installation's BIN folder. Something in DNN 7.1.2 changed, and now there is a conflict with this DLL. You'll need to delete the iFinity.FriendlyUrlProvider.dll from your website's BIN folder. You will also need to find any references to the DLL/NameSpaces in your web.config file.
Replace this (this first one probably isn't used in IIS 7+ websites, but if your web.config has it, change it)
<add name="UrlRewrite" type="iFinity.DNN.Modules.FriendlyUrl.UrlRewriteModule, iFinity.FriendlyUrlProvider" />
with this
<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" />
and replace this
<add name="UrlRewrite" type="iFinity.DNN.Modules.FriendlyUrl.UrlRewriteModule, iFinity.FriendlyUrlProvider" preCondition="managedHandler" />
with this
<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
Then finally your friendlyUrl section of the web.config should most likely look like this
<friendlyUrl defaultProvider="DNNFriendlyUrl">
<providers>
<clear />
<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="Advanced" />
</providers>
</friendlyUrl>
I hope that this blog post helps someone else save a little time, I spent quite a bit longer than I normally do with DNN upgrades tonight.