This project is read-only.
1

Resolved

RenderPartialFromSkin triggers a NullReferenceException when rendering comments

description

The new RenderPartialFromSkin triggers a NullReferenceException when rendering comments. It crashes because htmlHelper.ViewData["OxiteViewEngines"] is null. This occurs when a template calls RenderPartialFromSkin with model data, because in that case the ViewData is not propagated.
 
For example, Comments.ascx invokes it with a model, like so:
<% Html.RenderPartialFromSkin("CommentListMedium", new OxiteModelList...) %>
 
And, when it gets into the CommentListMedium.ascx template, it invokes RenderPartialFromSkin:
<% Html.RenderPartialFromSkin("Comment", new OxiteModelPartial...) %>
 
This is where the null reference exception occurs, because the earlier RenderPartialFromSkin call didn't propagate the ViewData. The bug appears around line 803, where it executes the following if it sees the model:
 // htmlHelper.ViewData is not passed through when a model is present
 newViewData = viewData == null ? new ViewDataDictionary(model) : new ViewDataDictionary(viewData) { Model = model };

comments

skewed wrote Mar 17, 2009 at 4:42 AM

This should be all fixed up with todays changes.

wrote Mar 17, 2009 at 4:42 AM

wrote Feb 21, 2013 at 11:43 PM

wrote May 16, 2013 at 11:38 AM

wrote May 16, 2013 at 11:38 AM

wrote Jun 14, 2013 at 8:23 AM