Users discovered a bug "UserID blank in template". I believe the bug is for the reason the UserID is passed in the URL as "tabid/89/Detail/True/UserID/15/Default.aspx' for users needing the UserID passed in the form of a query string as "tabid/89/Detail/True/UserID/15/Default.aspx?AccountID=15"
I created the following workaround on my blog at "http://www.vessea.com/Blog/tabid/58...plate.aspx"
Step 1: Create a property field named in my example I created "AccountID" this will be the field that has the "UserID" value.
Step 2: Create a stored procedure below is a sample working stored procedure I used on my site.
-- CODE COPY BEGIN
USE [VesseaProdPortal]
GO
/****** Object: StoredProcedure [dbo].[Game_AccountUpdate] Script Date: 08/30/2009 01:27:31 ******/
IF EXISTS (SELECT *
FROM sys.objects
WHERE object_id = Object_id(N'[dbo].[Game_AccountUpdate]')
AND TYPE IN (N'P',N'PC'))
DROP procedure [dbo].[game_accountupdate]
GO
USE [vesseaprodportal]
GO
/****** Object: StoredProcedure [dbo].[Game_AccountUpdate] Script Date: 08/30/2009 01:27:31 ******/
SET ansi_nulls ON
GO
SET quoted_identifier ON
GO
-- =============================================
-- Author: Matthew David Elgert
-- Create date: 8/30/2009
-- Description: VESSEA Game Account Update
-- Example: EXEC [dbo].[game_accountupdate]
-- =============================================
CREATE PROCEDURE [dbo].[game_accountupdate]
AS
BEGIN
/*T-SQL loop values BEGIN */
DECLARE @RowCount INT,
@I INT,
@UserID VARCHAR(8),
@CDT DATETIME
SET @RowCount = 0
SET @UserID = 0
SET @I = 1
SELECT @CDT = Getdate()
DECLARE @USERS TABLE(
recid INT IDENTITY ( 1 , 1 ),
[userid] INT
)
/*T-SQL loop values END */
/*T-SQL collect the empty accounts that get update into a temp table BEGIN*/
INSERT INTO @USERS
([userid])
SELECT p.[userid]
FROM [dbo].[userportals] p
WHERE p.[portalid] = 1
AND [userid] NOT IN (SELECT DISTINCT [userid]
FROM [dbo].[userprofile]
WHERE [propertydefinitionid] = 71)
SELECT @RowCount = @@ROWCOUNT
/*T-SQL collect the empty accounts that get update into a temp table END*/
/*T-SQL loop through and update accounts BEGIN */
WHILE (@I <= @RowCount)
BEGIN
SELECT @UserID = (SELECT [userid]
FROM @USERS
WHERE recid = @I)
EXEC dbo.Updateuserprofileproperty
@ProfileID = NULL ,
@UserID = @UserID ,
@PropertyDefinitionID = 71 ,
@PropertyValue = @UserID ,
@Visibility = 2 ,
@LastUpdatedDate = @CDT
SET @I = @I
+ 1
END
/*T-SQL loop through and update accounts END */
END
GO
-- CODE COPY END
Step 3: Create a VB class at /App_code below is the sample class I created for my site named VESSEASchedulerGameAccountUpdate.vb.
'CODE COPY BEGIN
'DNN Schedule name - VESSEA.SchedulerGameAccountUpdate
Imports System.Collections
Imports System.Globalization
Imports DotNetNuke.Modules.Events
Namespace VESSEA
Public Class SchedulerGameAccountUpdate
Inherits DotNetNuke.Services.Scheduling.SchedulerClient
#Region "Constructors"
Public Sub New(ByVal objScheduleHistoryItem As DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
MyBase.new()
Me.ScheduleHistoryItem = objScheduleHistoryItem
End Sub
#End Region
#Region "Methods"
Public Overrides Sub DoWork()
Try
'notification that the event is progressing
Me.Progressing() 'OPTIONAL
Dim returnStr As String
returnStr = HandleScheduler()
Me.ScheduleHistoryItem.AddLogNote(returnStr)
Me.ScheduleHistoryItem.Succeeded = True 'REQUIRED
Catch exc As Exception 'REQUIRED
Me.ScheduleHistoryItem.Succeeded = False 'REQUIRED
Me.ScheduleHistoryItem.AddLogNote("Scheduler Game Account Update." + exc.ToString + Me.Status) 'OPTIONAL
'notification that we have errored
Me.Errored(exc) 'REQUIRED
'log the exception
LogException(exc) 'OPTIONAL
End Try
End Sub
Private Function HandleScheduler() As String
Try
Me.Progressing()
Dim mySqlString As New StringBuilder()
mySqlString.Append("EXEC [dbo].[game_accountupdate]")
DataProvider.Instance().ExecuteSQL(mySqlString.ToString())
'Create log message
Me.ScheduleHistoryItem.Succeeded = True 'REQUIRED
Me.ScheduleHistoryItem.AddLogNote("Task completed with out errors." + Me.Status) 'OPTIONAL
Catch ex As Exception
Me.ScheduleHistoryItem.Succeeded = False
Me.ScheduleHistoryItem.AddLogNote("Scheduler Game Account Update failed. " & ex.ToString)
Me.Errored(ex)
End Try
End Function
#End Region
End Class
End Namespace
'CODE COPY END
Step 4: Create a schedule service login as host go to schedule.
Create a service name in my example I call the service "VESSEA.SchedulerGameAccountUpdate" schedule to run every 5 minutes.
Step 5: Select the [AccountID] this field returns the [UserID] value now.
This will work around the blank [UserID] field issue and return the following URL for a query string http://www.yourdomainname.comtabid/89/Detail/True/UserID/15/Default.aspx?AccountID=15