Getting Error for skin customization to Catalust2-H-Trans after upgrading from DNN 9.1 to DNN 9.2 - dotnetnuke

I get the error below after upgrading to DNN 9.2 from DNN 9.1. I have gone to look at the code from the specific file for that error. The error wipes away the site CSS for the customization.
Could Not Load Theme: /Portals/_default/Skins/Catalyst2-H-Trans/Template-SemiBoxed-02.ascx, Error: C:\inetpub\wwwroot\DotNetNuke\Portals\_default\Skins\Catalyst2-H-Trans\Template-SemiBoxed-02.ascx(20): error BC30456: 'Version' is not a member of 'DotNetNuke.Entities.Portals.PortalSettings'
<%# Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%# Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%# Register TagPrefix="dnn" TagName="CURRENTDATE" Src="~/Admin/Skins/CurrentDate.ascx" %>
<%# Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>
<%# Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%# Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%# Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%# Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%# Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%# Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%# Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%# Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
<%# Register TagPrefix="dnn" Namespace="DotNetNuke.UI.Skins" Assembly="DotNetNuke" %>
<%# Register TagPrefix="dnn" TagName="JavaScriptLibraryInclude" Src="~/admin/Skins/JavaScriptLibraryInclude.ascx" %>
<dnn:JavaScriptLibraryInclude runat="server" Name="jQuery-Migrate" Version="1.2.1" SpecificVersion="LatestMajor" />
<script type='text/javascript' src='<%= SkinPath %>drnuke-main.js'></script>
<%
Dim strScriptsToAdd As String = ""
Try
Dim arrVersion() As String = PortalSettings.Version.Split(".")
If (CInt(arrVersion(0)) <= 4) Or ((CInt(arrVersion(0)) = 5) And (CInt(arrVersion(1)) = 0)) Then
strScriptsToAdd = strScriptsToAdd & "<script type='text/javascript' src='" & SkinPath & "drnuke-menu.js'></script>"
End If
If (CInt(arrVersion(0)) <= 4) Then
strScriptsToAdd = strScriptsToAdd & "<link rel='stylesheet' type='text/css' media='all' href='" & SkinPath & "css/dnn4.css'>"
End If
Catch
strScriptsToAdd = strScriptsToAdd & "<script type='text/javascript' src='" & SkinPath & "drnuke-menu.js'></script>"
End Try
%>
<%=strScriptsToAdd%>

If you can edit that file, simply change it to:
<%
Dim strScriptsToAdd As String = ""
strScriptsToAdd = strScriptsToAdd & "<script type='text/javascript' src='" & SkinPath & "drnuke-menu.js'></script>"
%>
You aren't running DNN 4 or 5, no need to maintain support for those legacy versions.

Related

Wicked_pdf keeps on rendering in the backend without showing anything in mail

I have a mailer in which I am trying to generate PDF and then send it as an attachment:
Here's my mailers/invoice_mailer.rb:
def invoice
#invoice = params[:invoice]
recipients = params[:recipients]
subject = params[:subject]
#message = params[:message]
attachments["invoice_#{#invoice.id}.pdf"] = WickedPdf.new.pdf_from_string(
render_to_string(pdf: "invoice", template: "invoices/pdf", layout: "layouts/pdf")
)
mail(to: invoice.client.email, subject: "Your todo PDF is attached", invoice: #invoice)
end
I have a pdf.erb file in app./views/invoices:
<%= react_component("Invoices/Invoice", { invoice: #invoice }) %>
I have a simple layout file, pdf.html.erb, in layouts/ :
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<%= wicked_pdf_stylesheet_link_tag "pdf" %>
<%= wicked_pdf_javascript_include_tag "number_pages" %>
</head>
<body onload="number_pages">
<div id="header">
<!--= wicked_pdf_image_tag 'thumbnail.png', height: "30", width: "auto"-->
</div>
<div id="content">
<%= yield %>
</div>
</body>
</html>
In the mailer preview spec (assume providing all the details):
InvoiceMailer.with(invoice:, recipients:, subject:, message:).invoice
Running the mailer, I get this in the terminal:
It keeps on rendering until I kill the server.
Can you please tell me what I am doing wrong?

Refused to execute script from packs/js/index-662807e73049021453fe.js' because its MIME type ('text/html')

Im deploying a website with aws ec2 instance using react/rails.
When running the server through rails s -e production
i get this error
Refused to execute script from 'http://<ip-address>/packs/js/index-662807e73049021453fe.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
my application.erb.html
<!DOCTYPE html>
<html>
<head>
<title>Production server</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'index' %>
</head>
<body>
<%= yield %>
</body>
</html>
Ive been looking for an answer for a week now.
Any help would be greatly appreciated.
Update:
my routes to catch all routes in routes.rb
root 'homepage#index'
get ':path', to: 'homepage#index', format: false
and that points to homepage view
<%= javascript_pack_tag 'index' %>
<%= react_component("App", {prerender: true}) %>

AngularJS don't work on view page when references on ViewMasterPage

I'm trying to use angularJS in an old asp.net mvc appication.
This application uses a ViewMasterPage
If I load the angularjs reference in the viewpage, it works just fine:
<%# Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%: Scripts.Render("~/bundles/ng") %>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<div ng-app="">
<p>{{ "Hello" + " World" }}</p>
<p>{{ 2 + 4 }}</p>
</div>
</script>
</html>
OUTPUT ANGULAR OK
but when I try lo load the reference to angular JS in the view master page, it doesnt work.
<script src="<%= Url.Content("~/Scripts/jquery-1.8.2.js") +"?"+ version %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jquery-ui-1.9.1.js") +"?"+ version %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/json2.min.js") +"?" + version%>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/angular.js") +"?"+ version %>" type="text/javascript"></script>
I know for sure, that is loading the script file, because if I load in both viewmasterpage and viewpage I'm getting this error:
WARNING: Tried to load angular more than once.
Please help me.
Thank you in advance.

How to diplay array in express ejs template

I am trying to show a json file isnide my express ejs template for that my json file looks like this :
Data File
For that my ejs file is like this:
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
<h1><% var a = title %></h1>
<%for (var result in a){%>
<li><%=result%></li>
<%}%>
</body>
</html>
When I sm using this code:<%=result%>
I am getting this result :
error
Books
I am trying t show all the data of books in my view file for that I am trying this code <%=result[0]%>but I am getting this value
.e
.B
I am trying to access Books Id or other detail how can I show it here in this view file.
I think you should go and read some docs EJS
here you can see the for loop example and for your solution the answer is very simple you need to use this code and you are done:
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
<h1><% var a = title %></h1>
<% var z = a["Books"] %>
<% for(var i=0; i<z.length; i++) { %>
<li>
<%= z[i].Tweet %>
</li>
<% } %>
</body>
</html>
I suggest you to use forEach:
<body>
<ul>
<% books.forEach(function(book){ %>
<li><%- book.id %></li>
<%});%>
</ul>
</body>

Insert different user data into a database table in jsp

i have problem to insert other user's data into a table in database. It's only success inserted by first. after a second user key in his/her data, it's failed. i have code like this:
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<tr height=20% >
<td colspan="1" ><img src="appbanner.png" width=100% height=20%></td>
</tr>
<title>Insert title here</title>
</head>
<body bgcolor="#D8CEF6" height="150">
<h1>Create Task : </h1>
<form name="createMemo" method="post" action="memoback.jsp">
<pre>
Your Memo Number : <input type ="text" name="number" size="30">
Enter Memo Text : <input type ="text" name="memotext" size="30" style="width:500px" style ="height:500px"><br>
<input type="submit" name="Submit" value="Create Memo" />
<input type="reset" name="Reset" value="Reset" />
</pre>
</form>
</body>
</html>
at my back end , i use jsp also to insert my code:
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<%# page import="java.sql.*" %>
<%# page import="java.io.*" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Create Task Page</title>
</head>
<body>
<%
String memonumber = request.getParameter("number");
String memotext = request.getParameter("memotext");
//String duedate = request.getParameter("date");
String connectionURL = "jdbc:derby://localhost:1527/db";
Connection connection = null;
Statement statement = null;
try{
Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
connection = DriverManager.getConnection(connectionURL,"db","db");
statement = connection.createStatement();
String SQL = "INSERT INTO MEMO(memoid,memotext,uname) VALUES ('"+memonumber+"','"+memotext+"','"+session.getAttribute("susername")+"')";
statement.executeUpdate(SQL);
response.sendRedirect("Home.jsp");
%>
Table is created successfully.
<%
}
catch(Exception ex){
ex.printStackTrace();
}
%>
</body>
</html>
In my database table, i have columns memoid, memotext and uname.
i can insert data in database by enter sql statement but i would like to let user add in themselves in system
Presume that users are having permissions in database table for DML operations.
Although writing Java code in JSP is highly discouraged, modify your try catch block as
try{
.....
.....
}
catch(SQLException ex){
System.out.println("exception "+ex.getMessage());
ex.printStackTrace();
}
finally{
statement.close();
connection.close();
}
Comment out response.sendRedirect("Home.jsp"); for the time being.

Resources