After upgrading to DNN 7.1.2 Site Settings doesn't work

After upgrading to DNN 7.1.2 Site Settings doesn't work

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-6e6aa00ca0d7
 
 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 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.

Recent Comments

Comment Avatar
it is strange that not all sites are affected - maybe it depends on database compatibility level.
Posted By: Sebastian Leupold on Sep 2013
Comment Avatar
I did an update of a DNN site that was installed fresh on 7.1.1 to 7.1.2. I didn't experience any of the problems that you have described. I am writing this comment just to express my gratitude that you provide this excellent information to help everyone that run into problems. I will bookmark your site and will definitively look here if I have any problems in the future. Thanks so much for sharing!
Posted By: Ronny Roe on Sep 2013
Comment Avatar
I ran into problem #1 which caused the upgrade wizard to freeze. I ran the above script through Management Studio. I then tried rerunning the upgrade but got the same error as the provider upgrade script is deleting the version from your script and then trying to re-create the bad version of GetRecycleModules. I ended up restoring the database and site to it's state before the upgrade and after copying the upgrade package over, I modified the provider upgrade script 07.01.02 under the SqlDataProvider folder to use vw_modules.moduleid in the Order By clause. After this the upgrade ran without error. How did you get the remaining upgrade process to complete?
Posted By: Phillip Austin on Sep 2013
Comment Avatar
Phillip, My upgrade process didn't stop after #1 failed, it continued on, so I simply ran the SQL fix and the site was fine after that.
Posted By: Chris Hammond on Sep 2013
Comment Avatar

Is there any way to make ifinity url rewriter working? Core url rewriter is not a suggestion for me becaurse in my case - it turns urls into someting like: http://www.mysite.com/REMOVEDBECAUSEITWASTOOUGLY.aspx witch you cant call a user friendly url = )

Posted By: Jaggy Smith on Oct 2013
Comment Avatar
Jaggy, I edited your URL because it was truly bad :D I honestly don't know what caused that, maybe a culture thing with Russian? You might need to follow up with DNNCorp on that issue, unfortunately I don't think the free Ifinity stuff will work anymore
Posted By: Chris Hammond on Oct 2013
Comment Avatar
re: Problem #1, there is a 2nd similar error at 26%. Do you have a scrip to fix that one as well? Thank you ~ Robert Baker
Posted By: Robert Baker on Oct 2013
Comment Avatar
Those bad urls are caused by url encoding. And many browsers (like IE for example) turns "friendly" urls into that mess. So russian DNN comunity made URL rewriter that replaces russain letters into similar looking english letters wich was great for seo too, but unfortunally it is based on ifinity url rewriter. = ) By the way we found a solution to make ifinity rewriter work after all. In files that cause errors with url rewriting(like - /DesktopModules/Admin/Tabs/ManageTabs.ascx.cs) you have to replace "new FriendlyUrlSettings(PortalId)"; with "new DotNetNuke.Entities.Urls.FriendlyUrlSettings(PortalId);" and site begins to work again in a way it should be.
Posted By: Jaggy Smith on Oct 2013
Comment Avatar
Wouldn't problem #2 have also been fixed by changing urlFormat="advanced" to urlFormat="humanfriendly"?
Posted By: Karin Gates on Oct 2013
Comment Avatar
Robert, I am not sure what your error is at 26%, does it show up in the log files?
Posted By: Chris Hammond on Oct 2013
Comment Avatar
Karin, no, unfortunately I don't believe that would fix the problem.
Posted By: Chris Hammond on Oct 2013
Comment Avatar
Hi Chris, i've updated 2 installation with no apparent problem. The only problem that i have encountered is that ADMIN/File Manager is not Working anymore. On the First installation, that was at earlier stage of developmente, i reapply the Blank Template and file manager start working again. On the second that is in production now, i don't want to try to reapply blank Template...... Do you have any suggestion? Thanks for your excellent work.
Posted By: Alessandro Boglio on Oct 2013
Comment Avatar
WOW! Thank God I found this site. I upgraded to 7.1.2 maybe a month ago and never noticed the issue until today. In a panic I googled and found this site. My only issue is at one point, like the author, I used the infinity URL provider (was evaluating it over a year ago) but forgot to remove it. After I deleted it, my site's functionality was returned. I love you man! (in a brotherly, non-romantic manner)
Posted By: warren barnes on Nov 2013

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your comment here.
If you can't type DNNRocks in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond

Chris Hammond is a father, husband, leader, software developer, photographer and car guy. Chris focuses on the latest in technology including artificial intelligence (AI) and has spent decades becoming an expert in ASP.NET and DotNetNuke (DNN) development. You will find a variety of posts relating to those topics here on the website. For more information check out the about Chris Hammond page.

Find me on Twitter, GitHub and LinkedIn.