forums problem

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.
3/4/2010 9:53:15 AM
Gravatar
Total Posts 26

forums problem

 

hi,

i'm having an problem in module forum,

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Npgsql.NpgsqlException: ERRO: 2201X: OFFSET must not be negative

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

system.log: 2010-03-03 14:20:34,887 ERROR mojoPortal.Web.Global - 200.129.43.145-pt-BR - /mojo22/Forums/ForumView.aspx?pageid=192&mid=155&ItemID=4
Npgsql.NpgsqlException:
OFFSET must not be negative
Severity: ERRO
Code: 2201X
at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext()
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject()
at Npgsql.ForwardsOnlyDataReader.GetNextRow(Boolean clearPending)
at Npgsql.ForwardsOnlyDataReader.Read()
at System.Data.Common.DbEnumerator.MoveNext()
at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
at System.Web.UI.WebControls.Repeater.DataBind()
at mojoPortal.Web.ForumUI.ForumView.PopulateControls()
at mojoPortal.Web.ForumUI.ForumView.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(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)
 

 

i need help

 

thanks everybody

 

hugs
 

3/4/2010 12:39:01 PM
Gravatar
Total Posts 18439

Re: forums problem

Hi,

On the page where your forums module exists, click the pencil next to the name of each forum and check the settings for Posts Per Page and Topics Per Page, make sure you have a positive integer value there.

Is there anything else you have not told me? Did you delete a lot of threads or posts or anything like that or is is a brand new forum?

Hope it helps,

Joe

3/4/2010 1:09:23 PM
Gravatar
Total Posts 26

Re: forums problem

hi joe,

Thanks for the reply.

i put post per page: one and topics per page: 1

resolve my problem,

but if i put one or more in topics per page the error come back

 

thank's joe

 

hugs to all

3/5/2010 9:19:44 AM
Gravatar
Total Posts 18439

Re: forums problem

Hi,

I have tried to reproduce this problem but I cannot, it works correctly for me.

Best,

Joe

3/19/2010 10:40:56 AM
Gravatar
Total Posts 4

Re: forums problem

Hi,

 

I have encountered the same problem as described above using PGSQL on a ubuntu machine. I have transferred the DB from a windows machine (where there was no problem) running pgqsl to a ubuntu machine running pgsql. All works fine apart from the same error when trying to use the forums:

 

ForumView.aspx?pageid=45&mid=38&ItemID=2
Npgsql.NpgsqlException:
OFFSET must not be negative
Severity: ERROR
Code: 2201X
at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext()
at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject()
at Npgsql.ForwardsOnlyDataReader.GetNextRow(Boolean clearPending)
at Npgsql.ForwardsOnlyDataReader.Read()
at System.Data.Common.DbEnumerator.MoveNext()
at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
at System.Web.UI.WebControls.Repeater.DataBind()
at mojoPortal.Web.ForumUI.ForumView.PopulateControls()
at mojoPortal.Web.ForumUI.ForumView.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(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)

 

Any help would be great thanks

 

Richard

8/17/2010 6:56:56 PM
Gravatar
Total Posts 8

Re: forums problem

I've downloaded yesterday the source code from Mercurial repository and used PostgreSQL as my DB. Played around with forum and experienced this error too. The bug came from 'mp_forumthreads_selectbyforumdesc_v2' and this is the code:

CREATE OR REPLACE FUNCTION mp_forumthreads_selectbyforumdesc_v2(integer, integer)
RETURNS SETOF mp_forumthreads_selectbyforumdesc_v2_type AS
$BODY$
declare
_forumid alias for $1;
_pagenumber alias for $2;
_threadsperpage int;
_totalthreads int;
_beginsequence int;
_rec mp_forumthreads_selectbyforumdesc_v2_type%ROWTYPE;

begin

select into _threadsperpage, _totalthreads
threadsperpage, threadcount
from mp_forums
where itemid = _forumid;

_beginsequence := _totalthreads - (_threadsperpage * _pagenumber) + 1;

for _rec in
select
t.threadid ,
t.forumid ,
t.threadsubject ,
t.threaddate ,
t.totalviews ,
t.totalreplies ,
t.sortorder ,
t.islocked ,
t.forumsequence ,
t.mostrecentpostdate ,
t.mostrecentpostuserid,
startedbyuserid ,
u.name as mostrecentpostuser ,
s.name as startedby
from mp_forumthreads t
left outer join mp_users u
on t.mostrecentpostuserid = u.userid
left outer join mp_users s
on t.startedbyuserid = s.userid
where t.forumid = _forumid
order by t.sortorder, t.mostrecentpostdate desc
limit _threadsperpage
offset _beginsequence
loop
return next _rec;
end loop;
return;
end$BODY$
LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER
COST 100
ROWS 1000;

I added this block:

IF (_beginsequence < 0) THEN
_beginsequence := 0;
END IF;

After: _beginsequence := _totalthreads - (_threadsperpage * _pagenumber) + 1;

To make sure that the variable _beginsequence will become 0 if became negative. And this fix works fine now.

I hope I did the right thing. ;)

8/18/2010 7:49:45 AM
Gravatar
Total Posts 18439

Re: forums problem

Hi,

Thanks! I've made the same change so this is fixed in the source code repository.

Best,

Joe

8/28/2010 4:42:47 AM
Gravatar
Total Posts 8

Re: forums problem

Hi Joe,

Just updated my sources the other day(through TortoiseHG). After I finished setting-up my development environment yesterday(reformatted my laptop and installed Win7 x64); I tried to rebuild it today and set-up the forum but it seems I was not able to get the latest fix for this or the patch is still not comitted. Thanks.

8/28/2010 7:23:19 AM
Gravatar
Total Posts 18439

Re: forums problem

Make sure you rebuild the entire solution, then visit the /Setup/Default.aspx page to run the upgrade scripts.

If you look under Administration > System Information you should see version 0.0.1.7 for the forums, the 0.0.1.7 upgrade script fixes the stored procedure.

Hope it helps,

Joe

8/28/2010 7:50:04 AM
Gravatar
Total Posts 8

Re: forums problem

Sorry, I've mistaken the 'Update' button in TortoiseHG as Update in SVN. I think it is Synchronize.

I'm really new in Mercurial.

Thanks!

8/28/2010 8:02:51 AM
Gravatar
Total Posts 18439

Re: forums problem

update only works after you have pulled the latest changes, pulling the latest changes does not apply it to your working copy, that is what the update button is for, so the process is pull the latest change sets then apply them to your working copy by update, then rebuild solution....

I haven't tried the synchronize button but maybe that does both pull changes and update, I'm not sure, I just pull changes then run the update command/button myself

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