Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Error in script: Add DMX Search to DNN Search
Last Post 02/07/2010 1:05 PM by Ad Spelt. 2 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Ad Spelt
New Member
New Member
Posts:9


--
02/03/2010 3:19 PM

DNN 05.02.02
DMX 05.02.02

When I run the script  "Add DMX Search to DNN Search " I got the message

System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'TabID', table 'C:\INETPUB\INTRANET\APP_DATA\MIJNINTRA.MDF.dbo.TabModules'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Can anyone tell me how to solve thi problem?

Kind regards,

Ad Spelt


Run Script

00: - Retrieving Settings
00: -  PortalId:  Success
00: -  TabId:  Success
00: -  ModuleId:  Success
00: -  Finding Script:  Success
00: -  Reading 'C:\Inetpub\Intranet\DesktopModules\Bring2mind\DMX\Admin\Scripts\SetSearchPane.Resources':  Success
00: -  Script title: Add DMX Search to DNN Search Results Page 00: -  Checking permission:  Success
00: -  Script description: This script adds DMX search to your DNN Search Results page.
00: -  Processing script:
 

  


BEGIN
DECLARE @SRT INT
SELECT @SRT = t.TabId
 FROM {databaseOwner}{objectQualifier}TabModules tm
  INNER JOIN {databaseOwner}{objectQualifier}Modules m ON m.ModuleId=tm.ModuleId
  INNER JOIN {databaseOwner}{objectQualifier}ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
  INNER JOIN {databaseOwner}{objectQualifier}DesktopModules dm ON dm.DesktopModuleID = md.DesktopModuleID
  INNER JOIN {databaseOwner}{objectQualifier}Tabs t ON t.TabID = tm.TabId
 WHERE dm.ModuleName='Search Results' 
  AND m.PortalID=56
IF (SELECT COUNT(tm.TabId)
FROM {databaseOwner}{objectQualifier}TabModules tm
INNER JOIN {databaseOwner}{objectQualifier}Modules m ON m.ModuleId=tm.ModuleId
INNER JOIN {databaseOwner}{objectQualifier}ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
INNER JOIN {databaseOwner}{objectQualifier}DesktopModules dm ON dm.DesktopModuleID = md.DesktopModuleID
INNER JOIN {databaseOwner}{objectQualifier}Tabs t ON t.TabID = tm.TabId
WHERE dm.ModuleName='Bring2mind\DMX'
AND t.TabId=@SRT) = 0
 BEGIN
  DECLARE @MDID INT
  SELECT @MDID = md.ModuleDefID FROM {databaseOwner}{objectQualifier}ModuleDefinitions md
   INNER JOIN {databaseOwner}{objectQualifier}DesktopModules dm ON dm.DesktopModuleID = md.DesktopModuleID
   WHERE dm.ModuleName='Bring2mind\DMX'
  DECLARE @MID INT
  INSERT INTO {databaseOwner}{objectQualifier}Modules (ModuleDefID, ModuleTitle, AllTabs, IsDeleted, InheritViewPermissions, PortalID)
   VALUES (@MDID, 'DMX Search Results', 0, 0, 1, 0)
  SELECT @MID = SCOPE_IDENTITY()
  INSERT INTO {databaseOwner}{objectQualifier}TabModules (TabID, ModuleID, PaneName, ModuleOrder, CacheTime, Alignment, Visibility, DisplayTitle, DisplayPrint, DisplaySyndicate)
   VALUES (@SRT, @MID, 'ContentPane', 2, 0, 'left', 0, 1, 1, 0)
  INSERT INTO {databaseOwner}{objectQualifier}ModuleSettings (ModuleID, SettingName, SettingValue)
   VALUES (@MID, 'DefaultPane', 'bring2mind/dmx/search.ascx')
 END
END


 

00: -  Running script:  Success
 

     bij System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   bij System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   bij System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   bij System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   bij System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   bij System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   bij System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   bij Bring2mind.DNN.Modules.DMX.Data.SqlDataProvider.ᜁ(String A_0)
   bij Bring2mind.DNN.Modules.DMX.Data.SqlDataProvider.ExecuteScript(String Script)



BEGIN
DECLARE @SRT INT
SELECT @SRT = t.TabId
 FROM dbo.TabModules tm
  INNER JOIN dbo.Modules m ON m.ModuleId=tm.ModuleId
  INNER JOIN dbo.ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
  INNER JOIN dbo.DesktopModules dm ON dm.DesktopModuleID = md.DesktopModuleID
  INNER JOIN dbo.Tabs t ON t.TabID = tm.TabId
 WHERE dm.ModuleName='Search Results' 
  AND m.PortalID=56
IF (SELECT COUNT(tm.TabId)
FROM dbo.TabModules tm
INNER JOIN dbo.Modules m ON m.ModuleId=tm.ModuleId
INNER JOIN dbo.ModuleDefinitions md ON m.ModuleDefID = md.ModuleDefID
INNER JOIN dbo.DesktopModules dm ON dm.DesktopModuleID = md.DesktopModuleID
INNER JOIN dbo.Tabs t ON t.TabID = tm.TabId
WHERE dm.ModuleName='Bring2mind\DMX'
AND t.TabId=@SRT) = 0
 BEGIN
  DECLARE @MDID INT
  SELECT @MDID = md.ModuleDefID FROM dbo.ModuleDefinitions md
   INNER JOIN dbo.DesktopModules dm ON dm.DesktopModuleID = md.DesktopModuleID
   WHERE dm.ModuleName='Bring2mind\DMX'
  DECLARE @MID INT
  INSERT INTO dbo.Modules (ModuleDefID, ModuleTitle, AllTabs, IsDeleted, InheritViewPermissions, PortalID)
   VALUES (@MDID, 'DMX Search Results', 0, 0, 1, 0)
  SELECT @MID = SCOPE_IDENTITY()
  INSERT INTO dbo.TabModules (TabID, ModuleID, PaneName, ModuleOrder, CacheTime, Alignment, Visibility, DisplayTitle, DisplayPrint, DisplaySyndicate)
   VALUES (@SRT, @MID, 'ContentPane', 2, 0, 'left', 0, 1, 1, 0)
  INSERT INTO dbo.ModuleSettings (ModuleID, SettingName, SettingValue)
   VALUES (@MID, 'DefaultPane', 'bring2mind/dmx/search.ascx')
 END
END


 


00:00:00.125 -  Instantiating Bring2mind.DNN.Modules.DMX.Framework.ModuleController, BRING2MIND.DNN.MODULES.DMX.CORE:  Success
00:00:00.125 - Finished Running Script
 

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
02/07/2010 11:11 AM
This script attempts to add a DMX instance to the Search Results page. Unfortunately there is no hard way to link to this page in DNN as there is no other clue than that it contains a module with the title "Search Results". If you have renamed that module this script will fail. I hope that some poin in the future DNN will offer a better way to hook into this, but for now we have this mechanism only.

You can easily do this manually as well. Go to the search results page in your portal and add an instance of DMX. Then under module settings set the control to load for the view to Search.ascx. That's it.

Peter
Ad Spelt
New Member
New Member
Posts:9


--
02/07/2010 1:05 PM

Dear Peter,

Thank you for your reaction. Your right,, it is easily to do it manually. It works great!

I have been looking for a solution for the error and I think I found it. In the script is a  "WHERE" statement. In my database, the Modulename of the Search Result-page is SearchResults, without space between the words.

Kind regards,

Ad


 WHERE dm.ModuleName='Search Results' 
 WHERE dm.ModuleName='SearchResults'

You are not authorized to post a reply.