![]() |
Little error in the SqlDataProvider script of WROX.Suggestion
Needing to get a grasp quickly on module development, I've downloaded the source version of WROX.Suggestion.
Setting it up failed in the execution of the script for the creation of new tables. By executing the instructions in 02.00.00.SqlDFataProvider, I could narrow down the problem to 2 stored procedures: WROX_GetSuggestionModulesAllTabs and WROX_GetSuggestionModulesThisTab. closer inspection of the code for the creation of those 2 stored procedures revealed that the colomn ModuleTitle is looked up in the table dbo.Modules where in fact it is a column of the table dbo.TabModules. Replacing 3 occurrences of 'm.ModuleTitle' with 'tm.ModuleTitle' resolves the error. |
In the DotNetNuke forums, I learned from Sebastian Leupold that this is due to a modification, introduced in DNN 05.4
Anyone trying the instructions from your book on DNN 05.4+ will hit this problem. The work-around is easy. After you unzip the files from the source code in your DesktopModules\WROX.Suggestion\ folder, edit the file 02.00.00.SqlDataProvider file in the wrox folder with a simple text editor. The last two instructions in the file look like this: CREATE PROCEDURE {databaseOwner}{objectQualifier}WROX_GetSuggestion ModulesAllTabs as declare @SuggestionModuleDefID int set @SuggestionModuleDefID = (select ModuleDefID from {databaseOwner}{objectQualifier}ModuleDefinitions where FriendlyName='WROX.Suggestion') select m.ModuleID, 'ModuleTitle' = m.ModuleTitle + ' (' + t.TabName + ')' from {databaseOwner}{objectQualifier}Modules m inner join {databaseOwner}{objectQualifier}TabModules tm on m.ModuleID = tm.ModuleID inner join {databaseOwner}{objectQualifier}Tabs t on tm.TabID=t.TabID where m.ModuleDefID = @SuggestionModuleDefID and t.IsDeleted = 0 order by t.TabID, m.ModuleTitle GO and the next one: CREATE PROCEDURE {databaseOwner}{objectQualifier}WROX_GetSuggestion ModulesThisTab @TabID int as declare @SuggestionModuleDefID int set @SuggestionModuleDefID = (select ModuleDefID from {databaseOwner}{objectQualifier}ModuleDefinitions where FriendlyName='WROX.Suggestion') select m.ModuleID, m.ModuleTitle from {databaseOwner}{objectQualifier}Modules m Inner Join {databaseOwner}{objectQualifier}TabModules tm on m.ModuleID = tm.ModuleID where m.ModuleDefID = @SuggestionModuleDefID and tm.TabID = @TabID order by ModuleTitle GO This code is no longer compatible with DNN 05.4+ and should be replaced with the following code: CREATE PROCEDURE {databaseOwner}{objectQualifier}WROX_GetSuggestion ModulesAllTabs as declare @SuggestionModuleDefID int set @SuggestionModuleDefID = (select ModuleDefID from {databaseOwner}{objectQualifier}ModuleDefinitions where FriendlyName='WROX.Suggestion') select m.ModuleID, 'ModuleTitle' = tm.ModuleTitle + ' (' + t.TabName + ')' from {databaseOwner}{objectQualifier}Modules m inner join {databaseOwner}{objectQualifier}TabModules tm on m.ModuleID = tm.ModuleID inner join {databaseOwner}{objectQualifier}Tabs t on tm.TabID=t.TabID where m.ModuleDefID = @SuggestionModuleDefID and t.IsDeleted = 0 order by t.TabID, tm.ModuleTitle GO CREATE PROCEDURE {databaseOwner}{objectQualifier}WROX_GetSuggestion ModulesThisTab @TabID int as declare @SuggestionModuleDefID int set @SuggestionModuleDefID = (select ModuleDefID from {databaseOwner}{objectQualifier}ModuleDefinitions where FriendlyName='WROX.Suggestion') select m.ModuleID, tm.ModuleTitle from {databaseOwner}{objectQualifier}Modules m Inner Join {databaseOwner}{objectQualifier}TabModules tm on m.ModuleID = tm.ModuleID where m.ModuleDefID = @SuggestionModuleDefID and tm.TabID = @TabID order by ModuleTitle GO Save the file and continue with the instructions. WROX.Suggestions will from there on work like the book says it should. |
Help
I replaced the code from the two stored procedures but this didn't fix the problem. I think I did something wrong here.
|
I got through it and make it work (actually, I made an module of my own, a page hit counter). If you tell me what error you have, I might help you out?
|
I've reported on the issues I met going through the procedure from the book in the DNN forums. You can read them here: http://www.dotnetnuke.com/Resources/...s/Default.aspx
I hope this helps you figure it out. |
Change WROX_GetSuggestion ModulesAllTabs
to WROX_GetSuggestionModulesAllTabs and Change WROX_GetSuggestionModulesThisTab to WROX_GetSuggestionModulesThisTab in the above fix and it will work |
| All times are GMT -4. The time now is 08:33 PM. |
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.