Error when viewing Expired Posts

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
6/22/2014 6:02:37 PM
Gravatar
Total Posts 32

Error when viewing Expired Posts

Hi Joe,

I get an error when trying to view Expired posts in Blog Administration, when using MSSQL. My version is 2.4.0.3 MSSQL, ASP.NET v4.0.30319. I see there is a fix for MYSQL. Has anyone else experienced this?

My System Log:

2014-06-20 14:48:26,340 ERROR 192.168.101.157 - en-AU - /Blog/ClosedPosts.aspx?pageid=21&mid=27 - mojoPortal.Web.Global -  Referrer(http://intranet/Blog/Manage.aspx?pageid=21&mid=27) useragent Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
System.IndexOutOfRangeException: HeadlineImageUrl
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at System.Data.SqlClient.SqlDataReader.get_Item(String name)
   at mojoPortal.Business.Blog.GetClosedDataSet(Int32 moduleId, Int32 pageNumber, Int32 pageSize, Int32& totalPages)
   at mojoPortal.Web.BlogUI.ClosedPostsPage.BindList()
   at mojoPortal.Web.BlogUI.ClosedPostsPage.Page_Load(Object sender, EventArgs e)
   at mojoPortal.Web.mojoBasePage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks
Sandy

6/25/2014 7:07:42 AM
Gravatar
Total Posts 18444

Re: Error when viewing Expired Posts

Hi Sandy,

Sorry for the delayed response, we had a problem with our forums notification for several days and I missed this post. I will look into this today and post a response later today.

Thanks,

Joe

6/25/2014 10:17:13 AM
Gravatar
Total Posts 18444

Re: Error when viewing Expired Posts

Hi Sandy,

I will fix this for the next release, but you can fix it in your copy immediately by executing this sql script on your database:

ALTER PROCEDURE [dbo].[mp_Blogs_SelectClosed]

-- Author:               Joe Audette
-- Created:             2012-11-11
-- Last Modified:         2014-06-25

@ModuleID int,
@CurrentTime datetime,
@PageNumber int,
@PageSize int

AS

DECLARE @PageLowerBound int
DECLARE @PageUpperBound int


SET @PageLowerBound = (@PageSize * @PageNumber) - @PageSize
SET @PageUpperBound = @PageLowerBound + @PageSize + 1

CREATE TABLE #PageIndex 
(
    IndexID int IDENTITY (1, 1) NOT NULL,
ItemID Int
)

BEGIN

INSERT INTO #PageIndex ( 
ItemID
)

SELECT
        [ItemID]
        
FROM
        [dbo].[mp_Blogs]
        
WHERE
(ModuleID = @ModuleID)  
                AND EndDate < @CurrentTime

ORDER BY

    StartDate DESC

END


SELECT
        b.BlogGuid,
            b.ModuleGuid,
            b.ItemID, 
            b.ModuleID, 
            b.CreatedByUser, 
            b.CreatedDate, 
            b.Heading, 
            b.SubTitle,
            b.[Abstract], 
            b.[Description], 
            b.StartDate,
            b.EndDate,
            b.IsInNewsletter, 
            b.IncludeInFeed,
            b.AllowCommentsForDays,
            b.MetaKeywords,
            b.MetaDescription,
            b.Location,
            b.UserGuid,
            b.LastModUserGuid,
            b.LastModUtc,
            b.ItemUrl,
            
            b.ShowAuthorName,
            b.ShowAuthorAvatar,
            b.ShowAuthorBio,
            b.UseBingMap,
            b.MapHeight,
            b.MapWidth,
            b.ShowMapOptions,
            b.ShowZoomTool,
            b.ShowLocationInfo,
            b.UseDrivingDirections,
            b.MapType,
            b.MapZoom,
            b.ShowDownloadLink,
            b.HeadlineImageUrl,
            b.IncludeImageInExcerpt,
            
            CONVERT(nvarchar(20), b.CommentCount) AS CommentCount,
            COALESCE(u.UserID, -1) AS UserID,
            u.[Name],
            u.[LoginName],
            u.FirstName,
            u.LastName,
            u.Email,
            u.AvatarUrl,
            u.AuthorBio
        
FROM
        [dbo].[mp_Blogs] b

JOIN            #PageIndex t2
ON            
        b.[ItemID] = t2.[ItemID]
        
LEFT OUTER JOIN        mp_Users u
ON            b.UserGuid = u.UserGuid
        
WHERE
        t2.IndexID > @PageLowerBound 
        AND t2.IndexID < @PageUpperBound
        
ORDER BY t2.IndexID

DROP TABLE #PageIndex


GO

Thanks,

Joe

6/25/2014 9:12:48 PM
Gravatar
Total Posts 32

Re: Error when viewing Expired Posts

Thanks Joe, that fixed it. I'm trying to get authorisation to buy you a couple of beers/coffees! Appreciate your help. :)

6/26/2014 12:47:26 AM
Gravatar
Total Posts 32

Re: Error when viewing Expired Posts

Enjoy :)

6/26/2014 7:16:22 AM
Gravatar
Total Posts 18444

Re: Error when viewing Expired Posts

Thank you very much Sandy! Much appreciated!

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.