Problem seemed to be due to a few of the stored procedures in the installation script not working properly. Two user stored procedures (Forum_UserGet and Forum_UserGetByAlias) were referencing Forum_Moderators directly. This would be fine unless you are using an object qualifier (which would explain why only some experienced the issue)
The other issue I ran into was posts not being bumped up nor displaying the last posted date. They would always display the created date for both. This was a problem with the Forum_ThreadGetAll stored procedure. I have included references to all the stored procedures that need to be updated. Simply run this in the SQL portion of DNN.
/* Forum_ThreadGetAll */
ALTER PROCEDURE {databaseOwner}{objectQualifier}Forum_ThreadGetAll
(
@ForumID int,
@UserID int,
@PageSize int,
@PageIndex int,
@Filter nvarchar(500)
)
AS
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int
-- Set the page bounds
SET @PageLowerBound = @PageSize * @PageIndex
SET @PageUpperBound = @PageLowerBound + @PageSize + 1
-- Create a temp table to store the select results
CREATE TABLE #PageIndex
(
IndexID int IDENTITY (1, 1) NOT NULL,
ThreadID int
)
-- INSERT into the temp table
-- Create dynamic SQL to populate temporary table
DECLARE @sql nvarchar(1000)
SELECT @sql = 'INSERT INTO #PageIndex (ThreadID) SELECT {objectQualifier}Forum_Threads.ThreadID' +
' FROM {objectQualifier}Forum_Threads, {objectQualifier}Forum_Posts (nolock) ' +
' WHERE {objectQualifier}Forum_Posts.PostID = {objectQualifier}Forum_Threads.LastPostedPostID' +
--' AND {objectQualifier}Forum_Posts.PostID = {objectQualifier}Forum_Threads.ThreadID' +
' AND {objectQualifier}Forum_Threads.ForumID = ' + CONVERT(varchar, @ForumID) +
' AND {objectQualifier}Forum_Posts.IsApproved = 1' +
' AND {objectQualifier}Forum_Posts.IsLocked = 0 ' +
@Filter +
' ORDER BY {objectQualifier}Forum_Threads.IsPinned DESC, {objectQualifier}Forum_Posts.CreatedDate DESC'
EXEC(@sql)
Print @PageLowerBound
Print @PageUpperBound
SELECT
C.[Subject],
C.[Body],
C.[CreatedDate],
A.[Alias] AS StartedByAlias,
A.[UserID] AS StartedByUserID,
B.[Alias] AS LastPostAlias,
B.[UserID] As LastPostUserID,
D.[CreatedDate] As LastPostedDate,
T.[ThreadID],
T.[Views],
T.[ForumID],
T.[LastPostedPostId],
T.[Image],
T.[ObjectTypeCode],
T.[ObjectID],
T.[IsPinned],
T.[PinnedDate],
C.[IsClosed],
C.[MediaURL],
C.[MediaNAV],
(SELECT Count([ThreadID]) FROM {objectQualifier}Forum_Posts (nolock) WHERE [ThreadID] = T.[ThreadID] AND [PostID] <> T.[ThreadID]) As Replies,
--(SELECT Distinct Count(UserID) FROM {objectQualifier}Forum_ThreadsRead (nolock) WHERE ForumID = T.ForumID AND UserID = @UserID AND ReadThreads LIKE '%' + CONVERT(varchar, T.ThreadID) + ';%') As IsRead,
ISNULL((SELECT Max([ThreadID]) FROM #PageIndex (nolock) WHERE [ThreadID] < T.[ThreadID]), 0) As PreviousThreadID,
ISNULL((SELECT Min([ThreadID]) FROM #PageIndex (nolock) WHERE [ThreadID] > T.[ThreadID]), 0) As NextThreadID,
(SELECT Distinct Count(UserID) FROM {objectQualifier}Forum_ThreadsRead (nolock) WHERE ForumID = T.ForumID AND UserID = @UserID AND D.CreatedDate > LastPurseDate AND ReadThreads NOT LIKE '%' + CONVERT(varchar, T.ThreadID) + ';%') As IsUnRead,
(SELECT Distinct Count(UserID) FROM {objectQualifier}Forum_TrackedThreads (nolock) WHERE UserID = @UserID AND ThreadID = T.ThreadID) As IsTracked,
ISNULL((SELECT Count([ThreadID]) FROM {objectQualifier}Forum_ThreadRating TR (nolock) WHERE TR.[ThreadID] = T.[ThreadID]), 0) As RatingCount,
ISNULL((SELECT AVG([Rate]) FROM {objectQualifier}Forum_ThreadRating TR (nolock) WHERE TR.[ThreadID] = T.[ThreadID]), 0) As Rating
FROM
{objectQualifier}Forum_Threads T (nolock) , {objectQualifier}Forum_Posts C (nolock) , {objectQualifier}Forum_Posts D (nolock) , {objectQualifier}Forum_Users A (nolock) , {objectQualifier}Forum_Users B (nolock) , #PageIndex PageIndex (nolock)
WHERE
T.ThreadID = PageIndex.ThreadID
AND PageIndex.IndexID > @PageLowerBound
AND PageIndex.IndexID < @PageUpperBound
AND T.ThreadID = C.PostID
AND C.ThreadID = D.ThreadID
AND D.PostID = T.LastPostedPostID
AND A.UserID = C.UserID
AND B.UserID = D.UserID
ORDER BY
PageIndex.IndexID
GO
/* Forum_UserGetByAlias */
ALTER procedure {databaseOwner}{objectQualifier}Forum_UserGetByAlias
(
@UserAlias nvarchar(100)
)
AS
SELECT
UR.*,
FUR.*,
--ISNULL((SELECT DISTINCT [UserID] FROM {objectQualifier}Forum_Moderators (nolock) WHERE {objectQualifier}Forum_Moderators.[UserID] = UR.[UserID]), 0) As IsModerator,
--(SELECT COUNT(DISTINCT [UserID]) FROM {objectQualifier}Forum_Moderators (nolock) WHERE [UserID] = UR.[UserID]) As IsTrusted,
ISNULL((SELECT NULLIF(COUNT(DISTINCT [UserID]), 0) FROM {objectQualifier}Forum_Moderators (nolock) WHERE [UserID] = UR.[UserID]), [IsTrusted]) AS IsTrusted,
(SELECT COUNT(DISTINCT [UserID]) FROM {objectQualifier}Forum_Moderators (nolock) WHERE {objectQualifier}Forum_Moderators.[UserID] = UR.[UserID]) As IsModerator,
(SELECT COUNT(DISTINCT [UserID]) FROM {objectQualifier}UsersOnline (nolock) WHERE {objectQualifier}UsersOnline.[UserID] = UR.[UserID]) As IsOnline,
ISNULL((SELECT SUM([PostsModerated]) FROM {objectQualifier}Forum_Moderators (nolock) WHERE {objectQualifier}Forum_Moderators.[UserID] = UR.[UserID]), 0) As PostsModerated, UR.Email
FROM
Users UR (nolock), Forum_Users FUR (nolock)
WHERE
FUR.[UserID] = UR.[UserID] AND
FUR.[Alias] = @UserAlias
GO
/* Forum_UserGet */
ALTER procedure {databaseOwner}{objectQualifier}Forum_UserGet
(
@UserID int
)
AS
SELECT
UR.*,
FUR.*,
--ISNULL((SELECT DISTINCT [UserID] FROM {objectQualifier}Forum_Moderators (nolock) WHERE {objectQualifier}Forum_Moderators.[UserID] = UR.[UserID]), 0) As IsModerator,
--(SELECT COUNT(DISTINCT [UserID]) FROM {objectQualifier}Forum_Moderators (nolock) WHERE [UserID] = UR.[UserID]) As IsTrusted,
ISNULL((SELECT NULLIF(COUNT(DISTINCT [UserID]), 0) FROM {objectQualifier}Forum_Moderators (nolock) WHERE [UserID] = UR.[UserID]), [IsTrusted]) AS IsTrusted,
(SELECT COUNT(DISTINCT [UserID]) FROM {objectQualifier}Forum_Moderators (nolock) WHERE {objectQualifier}Forum_Moderators.[UserID] = UR.[UserID]) As IsModerator,
(SELECT COUNT(DISTINCT [UserID]) FROM {objectQualifier}UsersOnline (nolock) WHERE {objectQualifier}UsersOnline.[UserID] = UR.[UserID]) As IsOnline,
ISNULL((SELECT SUM([PostsModerated]) FROM {objectQualifier}Forum_Moderators (nolock) WHERE {objectQualifier}Forum_Moderators.[UserID] = UR.[UserID]), 0) As PostsModerated,
FUR.[ThreadsPerPage],
FUR.[PostsPerPage],
FUR.[WhatsNewScrollDirection],
FUR.[WhatsNewNumberOfThread],
FUR.[WhatsNewScrollDelay],
FUR.[WhatsNewScrollAmount],
FUR.[WhatsNewTemplate],
FUR.[WhatsNewTrackingType],
FUR.[WhatsNewTrackingDuration],
FUR.[DefaultForumID],
FUR.[CollapseGroups],
UR.Email
FROM
{objectQualifier}Users UR (nolock), {objectQualifier}Forum_Users FUR (nolock)
WHERE
FUR.[UserID] = UR.[UserID] AND
UR.[UserId] = @UserID