i7MEDIA / mojoportal

mojoPortal is an extensible, cross database, mobile friendly, web content management system (CMS) and web application framework written in C# ASP.NET.
https://www.mojoportal.com
Other
199 stars 98 forks source link

User Thread List throws error if they have posted in a forum that is no longer published #205

Open JosephMDavis opened 1 year ago

JosephMDavis commented 1 year ago

Add forum module to a page and create a forum Add a post to the forum Remove the forum module from the page, don't delete it Go to Member List > Manage > User Activity > View Posts

The sql needs to return a -1 for PageId if it's null. Relevant corrected sql is below

PageID = ISNULL((SELECT TOP 1 PageID FROM mp_PageModules WHERE mp_PageModules.ModuleID = f.ModuleID AND (PublishEndDate IS NULL OR PublishEndDate > getutcdate())), -1),

which needs to replace this

(SELECT TOP 1 PageID FROM mp_PageModules WHERE mp_PageModules.ModuleID = f.ModuleID AND (PublishEndDate IS NULL OR PublishEndDate > getutcdate()) ) As PageID,

in [mp_ForumThreads_SelectPageByUser] stored procedure

need to do similar in other db layers