Quantcast
Channel: oxite Work Item Rss Feed
Viewing all articles
Browse latest Browse all 20

Reopened Issue: RenderPartialFromSkin triggers a NullReferenceException when rendering comments [7291]

$
0
0
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 };

Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>