Comments not posting. Renamed Parent Node Type Alias. Solution Included
Okay this is driving me a little crazy at the moment. Due to tight deadlines, i'm posting this now in the hope that somebody can help me quickly and save me downloading the source, compiling locally, and debugging to find what the null reference is.
I'm using the latest version of Blog 4 Umbraco (2.0.2.6). I know my site setup is the cause of the issue as i have installed the blog package on a fresh site on the same machine, and it works.
The form seems to function fine. Validation all works. Gravatar works. When i try to post a comment, the javascript does its thing, and even comes back telling me "Your comment has been posted, thank you very much". It lies!
Looking at the Post and response that's happening, i can verify that its getting the page ID correctly, and appending that to the base URL. I have tried to access that URL myself using the following:
Looks pretty sweet... all the content is there. But, the response i get back is as follows:
<error>
MESSAGE:
Exception has been thrown by the target of an invocation.
STACKTRACE:
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\umbracobase\baseHttpModule.cs:line 154
INNEREXCEPTION:
System.NullReferenceException: Object reference not set to an instance of an object.
at Umlaut.Umb.Blog.Library.Base.CreateComment(Int32 parentId) in d:\TeamCity\buildAgent\work\6c8a1edaa924eb51\Umlaut.Umb.Blog\Library\Base.cs:line 43
</error>
Aaaaand I just fixed it. I could delete this post entirely, but i'll leave it here in case somebody else has this problem.
The problem was caused by me having changed the Doc Type Alias of the parent blog page. Since the code checks for a node with a doc type alias of "Blog", and keeps iterating up the tree till it finds it, it was never finding it in my tree, hence the nasty failure.
Thanks to CodePlex for making it easy for me to see the source code. Not so much thanks to the developers for not mentioning to never change these doc type aliases. (though I guess I should have known that one myself - little bit silly on my part).
If you're reading this and its helped you solve the problem, i hope it saved you a heap of time. Give me a high five and share the love :)
Comments not posting. Renamed Parent Node Type Alias. Solution Included
Okay this is driving me a little crazy at the moment. Due to tight deadlines, i'm posting this now in the hope that somebody can help me quickly and save me downloading the source, compiling locally, and debugging to find what the null reference is.
I'm using the latest version of Blog 4 Umbraco (2.0.2.6). I know my site setup is the cause of the issue as i have installed the blog package on a fresh site on the same machine, and it works.
The form seems to function fine. Validation all works. Gravatar works. When i try to post a comment, the javascript does its thing, and even comes back telling me "Your comment has been posted, thank you very much". It lies!
Looking at the Post and response that's happening, i can verify that its getting the page ID correctly, and appending that to the base URL. I have tried to access that URL myself using the following:
http://kind.local/base/Blog4Umbraco/CreateComment/1226.aspx?author=Greg+Berlin&email=greg%40mydomain.com&url=http%3A%2F%2Fwww.google.com&comment=fd+adsfasdf
Looks pretty sweet... all the content is there. But, the response i get back is as follows:
Aaaaand I just fixed it. I could delete this post entirely, but i'll leave it here in case somebody else has this problem.
The problem was caused by me having changed the Doc Type Alias of the parent blog page. Since the code checks for a node with a doc type alias of "Blog", and keeps iterating up the tree till it finds it, it was never finding it in my tree, hence the nasty failure.
Thanks to CodePlex for making it easy for me to see the source code. Not so much thanks to the developers for not mentioning to never change these doc type aliases. (though I guess I should have known that one myself - little bit silly on my part).
If you're reading this and its helped you solve the problem, i hope it saved you a heap of time. Give me a high five and share the love :)
cheers
greg
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.