Blog Post/Comments Error When Upgrading to 8.0

Posted by Community Admin on 04-Aug-2018 15:16

Blog Post/Comments Error When Upgrading to 8.0

All Replies

Posted by Community Admin on 19-Mar-2015 00:00

I just upgraded from 7.0 to 8.0, and I am receiving the error below (also attached) when I try to view a blog post on the front end. 

 Any suggestions on how to fix? I see under BlogPost permissions there are no longer any permissions settings for Comments, so I assume this is causing the error. 

Server Error in '/' Application.
 
Object of type Telerik.Sitefinity.Blogs.Model.BlogPost does not support permission set "Comments".
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.ArgumentException: Object of type Telerik.Sitefinity.Blogs.Model.BlogPost does not support permission set "Comments".
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[ArgumentException: Object of type Telerik.Sitefinity.Blogs.Model.BlogPost does not support permission set "Comments".]
   Telerik.Sitefinity.Security.SecurityExtensions.IsGranted(ISecuredObject item, String permissionSet, String[] actions) +656
   Telerik.Sitefinity.Modules.GenericContent.Web.UI.Views.CommentsMasterView.IsCommentActionAllowed(String action) +195
   Telerik.Sitefinity.Modules.GenericContent.Web.UI.Views.CommentsMasterView.GetItemsList(IDataItem commentedItem, IContentViewDefinition definition) +154
   Telerik.Sitefinity.Modules.GenericContent.Web.UI.Views.CommentsMasterView.CommentsList_PreRender(Object sender, EventArgs e) +60
   Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e) +46
   System.Web.UI.Control.PreRenderRecursiveInternal() +113
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Control.PreRenderRecursiveInternal() +222
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297

Posted by Community Admin on 19-Mar-2015 00:00

Can you open your systemconfig and see if any of the items show an Error, maybe the comments module?

Posted by Community Admin on 19-Mar-2015 00:00

Hi Mike,

I also had this error with the News Module. Since I don't use the Comments module on the News page I removed these lines from the template markup:

<sf:ContentView ID="commentsListView" ControlDefinitionName="NewsCommentsFrontend"           MasterViewName="CommentsMasterView" ContentViewDisplayMode="Master" runat="server" />
<sf:ContentView ID="commentsDetailsView" ControlDefinitionName="NewsCommentsFrontend"          DetailViewName="CommentsDetailsView" ContentViewDisplayMode="Detail" runat="server" />

I did sent an email to Sitefinity and they are aware of this issue. Still it will be good if you also would open a support ticket.

Best,
Daniel

 

 

 

Posted by Community Admin on 19-Mar-2015 00:00

Thanks, Daniel. Removing the comments code from the blog post template fixed the error. Unfortunately, we do use comments on our blog posts, so that's not going to work as a permanent fix. 

Posted by Community Admin on 19-Mar-2015 00:00

Hello,

We have prepared a KB article addressing this issue. Please check it out, and let us know if you have further problems after applying the solution - Comments not working after an upgrade to Sitefinity 8.0 version


Regards, 
Georgi Chokov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 10-Jul-2015 00:00

I am having same error after upgrade.

Can you tell me where to find this:

 <sf:ContentView ID="commentsListView" ControlDefinitionName="NewsCommentsFrontend"

I did a grep in the website code and data and could only see a metion of commentsListView in Telerik.Sitefinity.XML: 

 <member name="P:Telerik.Sitefinity.Modules.Comments.CommentsResources.CommentsListViewTemplateName"> 

 

 ​

 

Posted by Community Admin on 10-Jul-2015 00:00

Download JustDecompile (free) lets you search in all the assemblies and view the code

Posted by Community Admin on 10-Jul-2015 00:00

I am having problems with this. Could you please tell me where to find these lines of code?

 

Can someone point to the file where this code is located?

Posted by Community Admin on 10-Jul-2015 00:00

Why do I need to use this? Shouldn't I be able to find this in the source somewhere? Isn't there a new dll that I can download somewhere?

 

Also.. "To resolve the problem you need to update your template". What template is this???

Posted by Community Admin on 10-Jul-2015 00:00

Sitefinity isn't open source, .net compiles code to DLLs, so its the only tool to view what's in them (well, the other one costs money).

Download JustDecompile (again, free) www.telerik.com/.../decompiler.aspx

Then just point it at your Sitefinity BIN folder and you can search inside every dll for classes and methods in there.

Posted by Community Admin on 10-Jul-2015 00:00

Ok. I downloaded the tool, found the reference to CommentsListView, it's in Telerik.Sitefinity.dll. Now what do I do next to fix my problem?

 

    [ControlTemplateInfo("CommentsResources", "CommentsListViewTemplateName", "CommentsTitle")]
    public class CommentsListView : SimpleScriptView

 

I still can't find this:

<sf:ContentView ID="commentsListView" ControlDefinitionName="NewsCommentsFrontend"

 

anywhere.​

Posted by Community Admin on 10-Jul-2015 00:00

Ok, I think I figured out where to find this code.

In sitefinity, it's under Design menu, click on Widget Templates menu. 

Then look at Blogs: OneCommand Blog Single.

Solution fixed the problem. 

This is what my code looks like:

 

 

<%@ Control Language="C#" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit"
    Assembly="Telerik.Sitefinity" %>
<%@ Register Src="~/Modules/Navigation/BlogNavigation.ascx" TagName="Navigation" TagPrefix="Blog" %>
<%@ Import Namespace="Telerik.Sitefinity" %>
  
<%@ Import Namespace="Telerik.Sitefinity.Modules.Comments" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend" TagPrefix="comments" %>
  
  
  <div class="blog_single_container">
<telerik:RadListView ID="SingleItemContainer" ItemPlaceholderID="ItemContainer" AllowPaging="False"
    runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
    <layouttemplate>
        <div class="sfpostDetails">
            <%-- <div class="sfpostLinksWrp">
                <sf:MasterViewHyperLink class="sfpostBack" Text="<%$ Resources:BlogResources, allposts %>" runat="server" />
            </div> --%>
            <asp:PlaceHolder ID="ItemContainer" runat="server" />
        </div>
    </layouttemplate>
    <itemtemplate>
        <sf:FieldListView ID="PostTitle" runat="server" 
            Text="0" Properties="Title" 
            WrapperTagName="h2" WrapperTagCssClass="sfpostTitle"
        />
        <div class="sfpostAuthorAndDate">
            <sf:FieldListView ID="PostDate" runat="server" 
                Format="PublicationDate.ToLocal():MMMM dd, yyyy" 
            />
        </div>
        <sf:ContentBrowseAndEditToolbar ID="BrowseAndEditToolbar" runat="server" Mode="Edit,Delete,Unpublish"></sf:ContentBrowseAndEditToolbar>
        <sf:FieldListView ID="PostContent" runat="server" 
            Text="0" Properties="Content" 
            WrapperTagName="div" WrapperTagCssClass="sfpostContent"
        />

            <asp:PlaceHolder ID="socialOptionsContainer" runat="server">
  
    </asp:PlaceHolder>

      
      
      
<comments:CommentsAverageRatingControl runat="server"
            ThreadKey='<%# ControlUtilities.GetLocalizedKey(Eval("Id"), null, CommentsBehaviorUtilities.GetLocalizedKeySuffix(Container.DataItem.GetType().FullName)) %>'
            NavigateUrl="#commentsWidget" AllowComments='<%# Eval("AllowComments") %>'
            DisplayMode="FullText"
            ThreadType='<%# Container.DataItem.GetType().FullName %>'/>
        <div class="sfnewsAuthorAndDate">

          
<comments:CommentsCountControl runat="server"
                ThreadKey='<%# ControlUtilities.GetLocalizedKey(Eval("Id"), null, CommentsBehaviorUtilities.GetLocalizedKeySuffix(Container.DataItem.GetType().FullName)) %>'
                NavigateUrl="#commentsWidget" AllowComments='<%# Eval("AllowComments") %>'
                DisplayMode="ShortText"
                ThreadType='<%# Container.DataItem.GetType().FullName %>'/>
          
          <comments:CommentsWidget runat="server"
               ThreadKey='<%# ControlUtilities.GetLocalizedKey(Eval("Id"), null, CommentsBehaviorUtilities.GetLocalizedKeySuffix(Container.DataItem.GetType().FullName)) %>'
               AllowComments='<%# Eval("AllowComments") %>' ThreadTitle='<%# Eval("Title") %>' ThreadType='<%# Container.DataItem.GetType().FullName %>'
               GroupKey='<%# ControlUtilities.GetUniqueProviderKey("Telerik.Sitefinity.Modules.News.NewsManager", Eval("Provider.Name").ToString()) %>'
               DataSource='<%# Eval("Provider.Name")%>' />
                
      
    </itemtemplate>
</telerik:RadListView>
    
  <div class="blog_controls">
    
  <Blog:Navigation runat="server" />
    
    
  </div>
  </div>​

 

This thread is closed