Admin and Posting Area Error

Aug 12, 2009 at 6:40 PM

Hi,

I downloaded Oxite yesterday and got the site setup, with the web server running under the visual studio web server on my laptop and the database on a main server.

I managed to get the site to setup successfully and the home page works, along with adding new pages, but the admin and creating a new blog post do not work. I get the following error while creating a new post:

Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error: 


Line 162:            Post newPost;
Line 163:
Line 164:            postService.AddPost(area ?? areaService.GetAreas()[0], postInput, currentUser, out validationState, out newPost);
Line 165:
Line 166:            //todo: (nheskew) need to do more than just return another action method because it's likely different actions will need different filters applied to it

Source File: C:\work\Projects\trunk\theouteredge\Oxite\Oxite.Mvc\Controllers\PostController.cs    Line: 164 

And this one when I try to enter the administration area:

 

Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error: 


Line 28:                 <h3><%=Model.Localize("ManageAreas", "Manage Areas") %></h3>
Line 29:                 <ul>
Line 30:                     <li><%=Html.Link(Model.Localize("Area.Manage", "Edit Area"), adminData.Areas.Count > 1 ? Url.AreaFind() : Url.AreaEdit(adminData.Areas[0]))%></li>
Line 31:                     <li><%=Html.Link(Model.Localize("Area.Add", "Add New area"), Url.AreaAdd()) %></li>
Line 32:                     <li><%=Html.Link("BlogML", adminData.Areas.Count > 1 ? Url.AreaFind() : Url.BlogML(adminData.Areas[0])) %></li>

Source File: c:\work\Projects\trunk\theouteredge\Oxite\OxiteSite\Views\Site\Dashboard.aspx    Line: 30 

Have I missed something in the database setup or website configuration?

Coordinator
Aug 13, 2009 at 12:34 AM

It doesn't sound like you missed anything, but somehow it seems like there isn't an area in the database.  Usually there's one in the oxite_Area table with a name of "Blog".  Can you verify that's in there or not?  I believe the setup should've added this (it's been a long time since I've looked at the code from the last release in February  :( ).  Let me know if there's an area in there or not.

Aug 13, 2009 at 9:30 PM

Hi Erik,

Thanks for you reply. I have just checked the database and there is nothing setup in the area table. I did get an error when accessed the site for the first time and tried to setup the site, but I can't remember what it was.

How can I get this setup correctly?  Should I drop the database and try again? At least that way if i get the error again I can post it on here for you.

Aug 13, 2009 at 10:10 PM

I dropped and recreated the database and that has work out, thanks for your help.

One thing I noticed first time it setup the system was that the site descritpion on the innitial setup page is not validated.  My site description went over the 250 character limit and the system crashed rather than throwing an error.  It worked on the site edit screen...

Coordinator
Aug 16, 2009 at 5:58 AM

We're in the middle of working on a new setup wizard that will replace what exists today so this problem will more than likely just "go away", but I added an issue to keep track of it just in case it creeps back up.

http://oxite.codeplex.com/WorkItem/View.aspx?WorkItemId=8516

Thanks for the report and glad you got it working!