MySQL cast exception when adding new modules.

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.
1/1/2006 3:06:39 AM
Gravatar
Total Posts 16
www.CodeWise.nl

MySQL cast exception when adding new modules.

I have to preform a:

     update mp_Modules set EditUserID=0;

Every time I add new modules, because otherwise I get a null reference when I click the edit module icon:

System.Exception: Unhandled Exception while processing NeatUpload child request ---> System.InvalidCastException: Cannot cast from source type to destination type.
in <0x0001d> System.DBNull:System.IConvertible.ToInt32 (IFormatProvider provider)
in <0x0008c> System.Convert:ToInt32 (System.Object value, IFormatProvider provider)
in <0x00016> System.Convert:ToInt32 (System.Object value)
in <0x001d3> mojoPortal.Business.Module:GetModule (Int32 moduleID)
in <0x0003d> mojoPortal.Business.Module:.ctor (Int32 moduleID)
in <0x00288> mojoPortal.Web.ModuleSettingsPage:Page_Load (System.Object sender, System.EventArgs e)
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0x00117> System.Web.UI.Control:OnLoad (System.EventArgs e)
in <0x000e5> System.Web.UI.Control:LoadRecursive ()
in <0x0011e> System.Web.UI.Page:InternalProcessRequest ()
in <0x000a1> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext context)--- End of inner exception stack trace ---
in <0x004a3> Brettle.Web.NeatUpload.UploadHttpModule:Application_BeginRequest (System.Object sender, System.EventArgs e)
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
in <0x0046f> System.Web.HttpApplication+<RunHooks>__0:MoveNext ()
I'm using mojoPortal 1.0 www.onshuis.tk
Before I do the Update statement, the EditUserID column contains NULL.
Regards,
Jelle Hissink
 
1/1/2006 3:19:12 AM
Gravatar
Total Posts 18439

Re: MySQL cast exception when adding new modules.

Thanks for letting me know Jelle. I see the problem in the code and will fix it asap.

You can also fix it by putting default value of 0 on that column in the db.

ALTER TABLE mp_Modules ALTER COLUMN EditUserID SET DEFAULT 0;

Cheers,

Joe
1/1/2006 5:24:42 AM
Gravatar
Total Posts 16
www.CodeWise.nl

Re: MySQL cast exception when adding new modules.

Ok, I'll do that for now then.

Regards,

Jelle

1/1/2006 5:56:03 AM
Gravatar
Total Posts 18439

Re: MySQL cast exception when adding new modules.

Thats actually the permanent fix, the bug is that the table creation code did not do that for you during setup. I am fixing that for the next release.

Thanks,

Joe
1/19/2006 1:44:58 AM
Gravatar
Total Posts 58

Re: MySQL cast exception when adding new modules.

That is a great fix.&nbsp; I was having trouble in my installation at trendoid.net but thought it was ASP.NET 2 problems.&nbsp; I used that sql and so many quirks went away.&nbsp; Thanks for posting it.
You must sign in to post in the forums. This thread is closed to new posts.