DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Updating DNN from version 8.0.4 to 9.10.2 and Telerik removal

Sort:
You are not authorized to post a reply.





New Around Here





    Hi everyone. I have a problem with configuring some files after upgrade to DNN 9.10.2. First of all, we had some custom skins with code blocks <% .. %> in it and I solved loading skins problem with adding <asp:PlaceHolder runat="server"> <% %> </asp>.

    BUT, new problem occured when I added our custom code we used in older versions written in Default.aspx.

    <%
            <%
            string[] roles = new DotNetNuke.Security.Roles.RoleController().GetRolesByUser(DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().UserID, new DotNetNuke.Entities.Users.OnlineUserInfo().PortalID);
            if (
                roles.Contains("Role1") ||
                roles.Contains("Role2") ||
                roles.Contains("Role3") ||
                roles.Contains("Role4") 
                )
            {
            .......
            }
            %>

    So, as GetRolesByUser is deprecated in DotNetNuke 6.2 I didn't find exactly with which one method to replace it? Found this: https://dnncommunity.org/forums/aft/1119  but I'm not sure if this would work? I tried with: UserController.GetUserById(PortalSettings.PortalId, DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo().UserID).Roles;

    but then I get

    When I delete any code in <asp:PlaceHolder runat="server"><% ..code.. %></asp:PlaceHolder> my page loads fine. Like it won't work with code between block <asp:PlaceHolder runat="server"><% .... %></asp:PlaceHolder>

    Any ideas?

     

    Also, I was wondering, regarding Telerik component vulnerability.. As we use several third party modules with Telerik and, for now, removing Telerik is not an option (but it definetly will be in future), I tested uninstalling Telerik from DNN and removing any references from web.config as described in documentation but copying back Telerik dll's to bin folder. So, just copying back dll's, with no references anywhere in config. In that case, our modules that user Telerik work, so I was wondering is there a way that this solution might be some kind of workaround to keep using Telerik without some security issues??






    Veteran Member





      Did you follow the DNN Platform Suggested Upgrade Path or did you upgrade directly?

      Did you check all the requirements? (.Net Framework version etc.)

      Happy DNNing!
      Michael

      Michael Tobisch
      DNN★MVP

      dnnWerk Austria
      DNN Connect





      Veteran Member





        You shouldn't try to remove Telerik until DNN 9.8 or newer.

        The replacement methods for various deprecated methods are normally highlighted in the deprecation warning itself. Regardless to whether it is or isn't, the easiest thing to do is find places in the source code of DNN. Then, follow the same development pattern in your own code.

        I know that's not a direct set of instructions, but this is all I normally need to do. It usually takes a couple of minutes per method and rarely involves more than 1-3 lines of code difference.





        New Around Here





          I did follow upgrade path but any c# code written in Default.aspx just breaks page... It worked in old version we had.

          Also, I upragded DNN to 9.10.2 version so that's why I'm trying to remove Telerik references but because removing Telerik from our third party is not an option in the moment I just wonder would my solution that was described in last post be kind of effective because our modules work with just Telerik dll's and with no references in web.config or elsewhere except our custom modules...






          Veteran Member





            Oh, I completely missed a critical detail about your post...  You're trying to change the core code of DNN by editing the Default.aspx.  I'm afraid any change to the core code of DNN is not technically supported and is not tested as a result.  

            If you need to edit the Default.aspx, we'd suggest finding any other way to add code.  There are numerous options to avoid this, including a theme object, adding code to the theme, and some third-party modules help do this.  

            So, I'm not sure you'll find a lot of information about how to safely edit the Default.aspx.  Sorry.  :(  

            The themes shouldn't necessarily need any editing just to upgrade DNN - at least not the type of edits you described.  If that edit was necessary, it might be best to show an example.  However, as long as general ASP.NET coding practices are followed, almost anything you can do in a custom ASCX or ASPX page can be done in your theme.  






            New Around Here





              Well, I managed to get it work but now I have some strange problem, when I'm logged in everything loads normally, but when I'm not logged in site just breaks. I get "Application Error".

              Log says nothing specific:

              DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
                 at ASP.default_aspx.__RenderBody(HtmlTextWriter __w, Control parameterContainer)
                 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
                 at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
                 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
                 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
                 at DotNetNuke.Framework.PageBase.Render(HtmlTextWriter writer)
                 at DotNetNuke.Framework.DefaultPage.Render(HtmlTextWriter writer)
                 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
                 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)






              New Around Here





                I solved the problem by adding <% If Request.IsAuthenticated %>. Now everything works as expected.

                You are not authorized to post a reply.

                These Forums are dedicated to the discussion of DNN Platform.

                For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                5. No Flaming or Trolling.
                6. No Profanity, Racism, or Prejudice.
                7. Site Moderators have the final word on approving / removing a thread or post or comment.
                8. English language posting only, please.

                Would you like to help us?

                Awesome! Simply post in the forums using the link below and we'll get you started.

                Get Involved