Add/Edit Page

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.
5/12/2006 4:37:01 AM
Gravatar
Total Posts 4

Add/Edit Page

Hi
I am using Windows XP Professional SP2, and a Microsoft SQL 2000 database. I've compiled MojoPortal v1.0.2 from source and I'm developing a few modules for my project.
I'm developing on Visual Studio .NET 2003, but I will deploy it on Apache with Mono on a Linux Server.

I use MSSQL as the database because I have other DB to add to project beside the mojo BD and they are already created and in use, so I set CacheMSSQLParameters to false.
When I debug with VS.NET 2003 on IIS server, after I logon with admin and try to add or edit a page I get this error:

Server Error in '/mojoPortal' Application.

Parameter '@SiteID' was supplied multiple times. @ShowChildMenuPages is not a parameter for procedure mp_Pages_Insert.

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.Data.SqlClient.SqlException: Parameter '@SiteID' was supplied multiple times. @ShowChildMenuPages is not a parameter for procedure mp_Pages_Insert.

Source Error:

Line 434:			}
Line 435:
Line 436: bool saved = currentPage.Save();
Line 437: pageID = currentPage.PageID;
Line 438:

Source File: C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\mojoportal\Web\Admin\PageSettings.aspx.cs    Line: 436

Stack Trace:

[SqlException: Parameter '@SiteID' was supplied multiple times.
@ShowChildMenuPages is not a parameter for procedure mp_Pages_Insert.]
mojoPortal.Data.dbPortal.PageSettings_Create(Int32 SiteID, Int32 ParentID, String PageName, String Skin, Int32 PageOrder, String AuthorizedRoles, String EditRoles, String CreateChildPageRoles, Boolean RequireSSL, Boolean ShowBreadcrumbs, Boolean ShowChildPageBreadcrumbs, String PageKeyWords, String PageDescription, String PageEncoding, String AdditionalMetaTags, Boolean UseUrl, String Url, Boolean OpenInNewWindow, Boolean ShowChildMenuPages, Boolean HideMainMenu) in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\mojoportal\MSSQLData\dbPortal.cs:2408
mojoPortal.Business.PageSettings.Create() in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\mojoportal\Business\PageSettings.cs:303
mojoPortal.Business.PageSettings.Save() in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\mojoportal\Business\PageSettings.cs:372
mojoPortal.Web.PageProperties.SavePageData() in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\mojoportal\Web\Admin\PageSettings.aspx.cs:436
mojoPortal.Web.PageProperties.Apply_Click(Object Sender, EventArgs e) in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\mojoportal\Web\Admin\PageSettings.aspx.cs:310
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()


Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032


I also set up a virtual machine with Suse 10.0, samba, apache with mono and virtual hosts following the tutorials you have on your homepage and even when I try to add or edit pages on the virtual environment I get the same error message.
I believe you updated the if statement and forgot the else statement or something like that.


Congratulations for your wonderfull job in MojoPortal. You really made a great job!


Cheers

João Pereira

5/12/2006 11:53:53 AM
Gravatar
Total Posts 18439

Re: Add/Edit Page

Hi,

Somehow your db is not in sync with the code.
Can you try using svn /trunk instead of 1.0.2? and re-create the db using the scripts from trunk?

Just updating the stored procedures using the script from trunk may be enough to fix it but if not, try a clean install.

If you are working with source code you should get svn trunk as it is more up to date and it will be easier to keep up with bug fixes in between releases.

I can't replicate this error using trunk so I think that will fix it for you. If not let me know.

Cheers,

Joe
5/12/2006 12:22:47 PM
Gravatar
Total Posts 18439

Re: Add/Edit Page

I'm not sure why I didn't get an error, I just found there was a bug in dbPortal.PageSettings_Create where it was passing in the SiteID in 2 paramaters. I just fixed it and committed it to svn trunk.

Cheers,

Joe
5/14/2006 7:37:12 AM
Gravatar
Total Posts 4

Re: Add/Edit Page

Hi

Thank you for spending time helping me.

I'll install svn / trunk instead of 1.0.2 and will make a clean install of all.

I'll let you know if that solved my problem.


Thanks

João Pereira
5/15/2006 4:44:44 AM
Gravatar
Total Posts 4

Re: Add/Edit Page

I've downloaded the svn / trunk and deleted the mojoportal db that was on my sql server and made a clean install of all.

I added the reference for MSSQL in MojoPortal.Business and in web.config configured the sql connecton and i've set the CacheMSSQLParameters to False.

The part of Parameter '@SiteID' was supplied multiple times error disapeared, but the @DefaultFriendlyUrlPattern is not a parameter for procedure mp_Sites_Insert still crashed the portal, this time when creating initial data with an empty db.

I've opened the dbPortal.cs in VS and searched the SiteSettings_Create method and compared it with the SP mp_Sites_Insert.
I noticed that when caching SQL Parameters the name of the parameter is not passed, but when not caching SQL Parameters, we have to pass the name of the parameter.
So I compared it with the SP and noticed that in line 310 the name of the parameter was @DefaultFriendlyUrlPattern, but the SP was expecting a parameter with the name @DefaultFriendlyUrlPatternEnum.

I changed that in dbPortal.cs and try to run the portal again. I got a new error Procedure 'mp_Sites_Insert' expects parameter '@AllowPageSkins', which was not supplied.

In the SP the parameter[5] is AllowUserSkins and the parameter[14] is AllowPageSkins.
When caching or not SQL Parameters I noticed that in parameter [5] and [14] the code passes AllowUserSkins value in both places instead of passing AllowPageSkins in the [14].

When not caching SQL Parameters, the name of the parameter[14] must be changed to @AllowPageSkins instead of @AllowUserSkins.
I've also changed the value in parameter [14] that passes in both places to AllowPageSkins instead of AllowUserSkins.

When running the portal again a new error appeared. Procedure 'mp_Roles_RoleExists' expects parameter '@SiteID', which was not supplied.

I've noticed that in line 1929-1931, when CacheMSSQLParameters is set to False, it passes the 2nd parameter in position [0] overwriting the 1st parameter.
I've fixed that and tried to run again.

This time I got an error that it's not part of the dbPortal.cs, and address a Null reference...


Server Error in '/mojoPortal' Application.

Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 69: 				SiteSettings siteSettings = (SiteSettings) HttpContext.Current.Items["SiteSettings"];
Line 70: skinFolder = "~/Data/Sites/" + siteSettings.SiteID.ToString() + "/skins/";
Line 71: skinName = siteSettings.Skin.Replace(".ascx","") + "/layout.ascx";
Line 72:
Line 73: // implement user skins

Source File: C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\MojoPortal SVN\Web\Components\MasterPage.cs    Line: 71

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
mojoPortal.Web.MasterPage..ctor() in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\MojoPortal SVN\Web\Components\MasterPage.cs:71
ASP.Default_aspx.__BuildControlMPContainer() in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\MojoPortal SVN\Web\Default.aspx:3
ASP.Default_aspx.__BuildControlTree(Control __ctrl) in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\MojoPortal SVN\Web\Default.aspx:1
ASP.Default_aspx.FrameworkInitialize() in c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mojoportal\657dc34f\b4344e93\qvoin4hh.0.cs:0
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

[Exception: Unhandled Exception while processing NeatUpload child request]
Brettle.Web.NeatUpload.UploadHttpModule.Application_BeginRequest(Object sender, EventArgs e) in C:\Documents and Settings\Joao\My Documents\Visual Studio Projects\MojoPortal SVN\NeatUpload\UploadHttpModule.cs:224
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032



This time I'm a little lost... :) If you could check this one for me I'll appreciate.

I tried to TortoiseSVN Commit the dbPortal.cs with the changes I made but I've failed do authenticate. Tried to login anonymous and with this page authentication but also failed. Is it required to register somewhere or I'm I just beeing dumb! :)

Cheers

João Pereira
5/15/2006 11:09:41 AM
Gravatar
Total Posts 4

Re: Add/Edit Page

While thinking about this last error, I decided to erase the DB. I've created the DB from the scripts again and tried to run the Portal.

Instead of the error mentioned above, I got a new one: @ShowChildMenuPages is not a parameter for procedure mp_Pages_Insert.

I compared the code and the SP again and noticed that in dbPortal.cs it passed the parameter @ShowChildMenuPages, but the SP mp_Pages_Insert expected a parameter named @ShowChildPageMenu. So on line 2381 of the dbPortal.cs, I've changed @ShowChildMenuPages to @ShowChildPageMenu.

I erased the DB and created it back again, and a new error occured: Index was outside the bounds of the array.
This error was pointing to line 5112. I've noticed that the code passed 10 parameters to the SP, but on line 5056 the SqlParameter arParams was initialized with 9 parameters instead of 10. I've changed this and cleaned the DB once again.

I tried to run the mojoPortal once again, and it started without any error. Now, with CacheSQLParameters set to False, the mojoPortal successfully creates the initial data with an empty Microsoft SQL DB, and it allows to add / edit pages successfully.

I think my problem is solved! :)

I'm enjoying a lot working with mojoPortal and I thank you for that! :)


Cheers

João Pereira


5/15/2006 2:04:16 PM
Gravatar
Total Posts 18439

Re: Add/Edit Page

I have committed the changes to svn trunk for all the issues you found.

Thanks!

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