Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 6 posts 26 karma points
    Nov 09, 2012 @ 17:43
    Tom
    0

    Null object cannot be converted to a value type

    Hi guys,

    I use nforum for more than a year now (1.2 on Umbraco 4.7.1).

    Suddenly I'm getting error Null object cannot be converted to a value type. The page wont load :-(

    As far as I found out, it is related just to nodes that has to do something with nforum (that contains any macro from nforum).

    When I tried debug mode, error leads to row 29 in file ForumActiveTopics.ascx.cs:

    maintopics = (from t in u.ForumTopics

    I found this thread http://our.umbraco.org/forum/ourumb-dev-forum/bugs/20901-umbraco-to-linq-null-object-issue-plus-solution-%28not-really%29 but problem is that I can't save all nodes in nforum, as I have hundreds of them, so I can't try if it works or not.

    Does anyone know about solution to this?

    Thank you a lot in advance!

    Tom

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 09, 2012 @ 18:40
    Jan Skovgaard
    0

    Hi Tom and welcome to our :)

    Have you changed anything in the installation? Or installed a new package for instance?

    What happens if you browse to the forum and add ?umbdebugshowtrace=1 - does the trace log give any further clues?

    /Jan

  • Tom 6 posts 26 karma points
    Nov 09, 2012 @ 19:59
    Tom
    0

    Hi Jan,

    thank you for your reply!

    I add some macros to nforum, but everything was OK for a few days and then the error occured :(

    Debug didn't tell me anything, or at least I don't see anything weird. Maybe you will (I'm not so experienced):

     

    Unhandled Execution Error
    Null object cannot be converted to a value type.
      at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
      at System.Convert.ChangeType(Object value, Type conversionType)
      at umbraco.Linq.Core.Node.NodeDataProvider.LoadFromXml[T](XElement xml, T node)
      at umbraco.Linq.Core.Node.NodeTree`1.GetEnumerator()
      at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
      at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
      at System.Linq.OrderedEnumerable`1.d__0.MoveNext()
      at System.Linq.Enumerable.d__3a`1.MoveNext()
      at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
      at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
      at nForum.usercontrols.nForum.KubaCestopisy.UkazCestopisyKuba() in D:\Umbraco\nForum\usercontrols\nForum\KubaCestopisy.ascx.cs:line 29
      at nForum.usercontrols.nForum.KubaCestopisy.Page_Load(Object sender, EventArgs e) in D:\Umbraco\nForum\usercontrols\nForum\KubaCestopisy.ascx.cs:line 14
      at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Control.LoadRecursive()
      at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    * please note that KubaCestopisy.ascx.cs is in fact copy of ForumActiveTopics.ascx.cs with just a slight change (I've used it for some time without any problem).

    Don't know if pasting of the whole trace information will help to determine the problem, I think it have to do something with our.umbraco.org/.../20901-umbraco-to-linq-null-object-issue-plus-solution-(not-really) but I don't know how to solve it at all :(

  • Tom 6 posts 26 karma points
    Nov 09, 2012 @ 20:05
    Tom
    0

    To clarify the situation - I'm not able to browse nforum. Every page that has any macro from nforum doesn't work - Null object cannot be converted to a value type error occures every time. But I can browse any other page, therefore I suspect nforum for having some problem, but I don't know where it could be...

    In fact I can't even click root node (Content) in Content section of Umbraco administration (the same error appears, probably because there is some nforum panel), but I can browse nforum content (all nodes of nforum) in administration (and that's weird).

  • Tom 6 posts 26 karma points
    Nov 09, 2012 @ 20:25
    Tom
    0

    Root node in Content section of Umbraco administration throws above mentioned error, but the trace seems little different:

    [InvalidCastException: Null object cannot be converted to a value type.]
     System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +12819958
     System.Convert.ChangeType(Object value, Type conversionType) +133
     umbraco.Linq.Core.Node.NodeDataProvider.LoadFromXml(XElement xml, T node) +1644
     umbraco.Linq.Core.Node.NodeTree`1.GetEnumerator() +527
     System.Linq.WhereEnumerableIterator`1.MoveNext() +107
     System.Linq.<TakeIterator>d__3a`1.MoveNext() +376
     System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +1819
     System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +94
     System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +18
     System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +182
     System.Web.UI.WebControls.DataBoundControl.PerformSelect() +274
     nForum.usercontrols.nForum.dashboard.ForumMainDashboard.GetBadPosts() in D:\Umbraco\nForum\usercontrols\nForum\dashboard\ForumMainDashboard.ascx.cs:27
     nForum.usercontrols.nForum.dashboard.ForumMainDashboard.Page_Load(Object sender, EventArgs e) in D:\Umbraco\nForum\usercontrols\nForum\dashboard\ForumMainDashboard.ascx.cs:11
     System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
     System.Web.UI.Control.LoadRecursive() +71
     System.Web.UI.Control.LoadRecursive() +190
     System.Web.UI.Control.LoadRecursive() +190
     System.Web.UI.Control.LoadRecursive() +190
     System.Web.UI.Control.LoadRecursive() +190
     System.Web.UI.Control.LoadRecursive() +190
     System.Web.UI.Control.LoadRecursive() +190
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

    Error leads to ForumMainDashboard.ascx.cs where nforum loads and display bad posts (spam). In my case it throws mentioned error.

  • Tom 6 posts 26 karma points
    Nov 12, 2012 @ 08:46
    Tom
    0

    Nobody knows how to solve this? :-(

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 12, 2012 @ 19:17
    Jan Skovgaard
    0

    Hi Tom

    Coming to think of it this may be due to some changes in the backoffice perhaps?

    Has there been any modifications done on document types in Umbraco? Have some pickers been used, which referene nodes that no longer exists etc.?

    /Jan

  • Tom 6 posts 26 karma points
    Nov 16, 2012 @ 08:39
    Tom
    0

    Hi Jan,

    yes, there have been some changes in document types etc, but I double check it now to be sure, it doesn't refere to nonexisting nodes.

    Weird is, that everything worked for few days and then suddenly error appeared.

    Isn't it possible that there is some problem with any kind of cache or xml file that nforum creates? It seems to me like some connection between nodes is broken. So maybe "reseting" nforum to reload all xml files and nodes would help, but I dunno how to do that and if it is even possible... Simple republishing etc don't work.

    Tom

Please Sign in or register to post replies

Write your reply to:

Draft