IndexOutOfRangeException with rev 4576

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.
2/6/2009 11:39:13 PM
Gravatar
Total Posts 29

IndexOutOfRangeException with rev 4576

after loading svn rev 4576 or 4578 there's an unhandled exception in mojoPortal.Business\SiteUser.cs Line: 566

Appears to be looking for the TotalRevenue column before the upgrade scripts get a chance to put it in. I'll put a catch to bypass for now but figured you'ld want to know.

 

-Greg

2/7/2009 5:33:06 AM
Gravatar
Total Posts 18439

Re: IndexOutOfRangeException with rev 4576

Hi Greg,

It should be ok that it throws this error, there are plenty of errors like this thrown during initial install. When an unhandled error occurs a check is made to see if an upgrade is needed and if so it redirects to /Setup/Default.aspx which will run the upgrade script.

So when you do svn update and then you run it in VS using the debugger, if you just tell it to continue at every error instead of stopping execution, then it should redirect to /Setup/Default.aspx

Best,

Joe

ps thanks for the patch, I will take a look later today

2/7/2009 12:03:59 PM
Gravatar
Total Posts 29

Re: IndexOutOfRangeException with rev 4576

I was curious as to how you got around the chicken and egg issues when adding new features that depend on database changes. I'll check that setting.

-GP

2/7/2009 12:19:39 PM
Gravatar
Total Posts 18439

Re: IndexOutOfRangeException with rev 4576

Well, actually with features I don't really have that. Its only the core that can detect if it needs an upgrade, the current version is hard coded into DatabaseHelper.DBCodeVersion() and I increment it there as needed. So if the mojoportal-core version in mp_SchemaVersion is less than that it knows it needs to run setup. But typically if included features have changed the core version is also changed (at least for official releases) so this is usually sufficient even for features. Those working from svn should pretty much always visit /Setup/Default.aspx after doing svn update and rebuild solution.

Its always safe to run the /Setup/Default.aspx page, as feature specific upgrade scripts will only be executed if they are of a higher version than what is currently in the mp_SchemaVersion table for the feature.

The difference is, higher version feature scripts will always be executed, but core scripts will only be executed if they are higher than what is in the db and less than or equal to what is reported by DatabaseHelper.DBCodeVersion(). So for the core I can commit the next version of script to svn but prevent it from running until I increment to that version in DatabaseHelper.DBCodeVersion(). Whereas with feature scripts, once I commit them to trunk they will run so if I make additional changes I have to use a new script version rather than keep editing the same one because svn users may have already run it and would miss any new edits. I do sometimes edit them in my sandbox, but once I merge to trunk its on to the next version for any new script work for features.

Best,

Joe

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