Issues after upgrade to 2.8

Topics: Business Logic Layer, Controls
Dec 3, 2013 at 9:15 AM
Dear all...

I have upgraded blogengine.net from 2.6 to 2.8 (including patch). After upgrade we are not able to manage comments anymore in the backend. In the commentlist, all checkbox are disabled. So it is not possible to select a single comment to delete.

Users are also not shown in the users list in the backend after the upgrade.

All data are still in the database

I've got no error during the upgrade.

I hope someone can help me with this.

Many thanks in advanced.

Fajar Ramadhany
Dec 3, 2013 at 2:06 PM
I'm also having issues after upgrading to 2.8. Did you run any DB scripts when you did the upgrade?
Coordinator
Dec 3, 2013 at 3:05 PM
Check JavaScript errors with FireBug or developer tools. Most common when after upgrade scripts get lost or duplicated and it makes UI misbehave.
Dec 6, 2013 at 11:01 PM
Thanks for the direction rtur,

I turned on script debugging and ran the application on my local machine. After I login I immediately get a script error. In qnotes.js, I get an error on the $(document).on() JQuery call. The error is:

"JavaScript runtime error: Object doesn't support property or method 'on'."

When I go through all of the .js included on this page it looks like they're all present and the paths are correct as I can click on them and the file will load in my browser, so not sure what is going on here. I created a screen capture of what I'm seeing.

Image
Dec 6, 2013 at 11:42 PM
Edited Dec 6, 2013 at 11:43 PM
Might be worth double checking your Scripts folder just in case it(or parts of it) never got updated for some reason.
BE 2.6 used jQuery 1.5.2(I think) and the jQuery.on method never got added to jQuery until jQuery 1.7.
Might be something completely different, but worth a look.
Dec 7, 2013 at 3:25 PM
Edited Dec 7, 2013 at 4:07 PM
Yeah I thought of that but it's loading JQuery 1.9.1 and the script "seems" to be accessible. Here is what my header tag looks like when I access the home page without logging in, and this works.
<head profile="http://gmpg.org/xfn/11"><meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link rel="contents" title="Archive" href="/blog/archive.aspx" />
    <link rel="start" title="Cheat Sheet War Blog" href="/blog/" />
    <link type="application/rsd+xml" rel="edituri" title="RSD" href="http://localhost/blog/rsd.axd" />
    <link type="application/rdf+xml" rel="meta" title="SIOC" href="http://localhost/blog/sioc.axd" />
    <link type="application/apml+xml" rel="meta" title="APML" href="http://localhost/blog/apml.axd" />
    <link type="application/rdf+xml" rel="meta" title="FOAF" href="http://localhost/blog/foaf.axd" />
    <link type="application/rss+xml" rel="alternate" title="Cheat Sheet War Blog (RSS)" href="http://localhost/blog/syndication.axd" />
    <link type="application/atom+xml" rel="alternate" title="Cheat Sheet War Blog (ATOM)" href="http://localhost/blog/syndication.axd?format=atom" />
    <link type="application/opensearchdescription+xml" rel="search" title="Cheat Sheet War Blog" href="http://localhost/blog/opensearch.axd" />
    <link href="/blog/Content/Auto/Global.css" rel="stylesheet" type="text/css" /><link rel="shortcut icon" href="pics/blogengine.ico" type="image/x-icon" /><link rel="stylesheet" href="themes/Classic/style-min.css" type="text/css" />
    <script type="text/javascript" src="/blog/en-gb.res.axd"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/01-jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/01-jquery.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/02-jquery.cookie.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/04-jquery-jtemplates.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/05-json2.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/05-json2.min.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/blog.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/dropdown.js"></script>
    <meta name="description" content="Providing fantasy football player rankings and strategy advice in support of our custom cheat sheet creation interface." />
    <meta name="keywords" content="Fantasy Football,Application Updates,Management &amp; Strategy,Player News,Wishful News,Fantasy Racing,Driver News,Misc,Site News" />
    <meta name="author" content="My name" />
<link rel="prev" title="Previous page" href="/blog/?page=2" /><title>
    Cheat Sheet War Blog | Providing fantasy football player rankings and strategy advice in support of our custom cheat sheet creation interface.
</title></head>
After I login, it looks like references are added to "Qnotes.css" and "qnotes.js" and it appears the qnotes.js has a dependency on JQuery. This seems to be where the problem lies. Is is possible that all of the .js references are wrong, and the home page (without login) just doesn't use any of those .js files? So it's only after logging-in and triggering the QNotes code that the error occurs?
<head profile="http://gmpg.org/xfn/11"><meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link rel="contents" title="Archive" href="/blog/archive.aspx" />
    <link rel="start" title="Cheat Sheet War Blog" href="/blog/" />
    <link type="application/rsd+xml" rel="edituri" title="RSD" href="http://localhost/blog/rsd.axd" />
    <link type="application/rdf+xml" rel="meta" title="SIOC" href="http://localhost/blog/sioc.axd" />
    <link type="application/apml+xml" rel="meta" title="APML" href="http://localhost/blog/apml.axd" />
    <link type="application/rdf+xml" rel="meta" title="FOAF" href="http://localhost/blog/foaf.axd" />
    <link type="application/rss+xml" rel="alternate" title="Cheat Sheet War Blog (RSS)" href="http://localhost/blog/syndication.axd" />
    <link type="application/atom+xml" rel="alternate" title="Cheat Sheet War Blog (ATOM)" href="http://localhost/blog/syndication.axd?format=atom" />
    <link type="application/opensearchdescription+xml" rel="search" title="Cheat Sheet War Blog" href="http://localhost/blog/opensearch.axd" />
    <link href="/blog/Content/Auto/Global.css" rel="stylesheet" type="text/css" />
    <link href="/blog/Modules/QuickNotes/Qnotes.css" rel="stylesheet" type="text/css" /><link rel="shortcut icon" href="pics/blogengine.ico" type="image/x-icon" /><link rel="stylesheet" href="themes/Classic/style-min.css" type="text/css" />
    <script type="text/javascript" src="/blog/en-gb.res.axd"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/01-jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/01-jquery.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/02-jquery.cookie.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/04-jquery-jtemplates.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/05-json2.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/05-json2.min.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/blog.js"></script>
    <script type="text/javascript" src="/blog/Scripts/Auto/dropdown.js"></script>
    <script type="text/javascript" src="/blog/Scripts/App/widget.js"></script>
    <script type="text/javascript" src="/blog/Scripts/App/qnotes.js"></script>
    <meta name="description" content="Providing fantasy football player rankings and strategy advice in support of our custom cheat sheet creation interface." />
    <meta name="keywords" content="Fantasy Football,Application Updates,Management &amp; Strategy,Player News,Wishful News,Fantasy Racing,Driver News,Misc,Site News" />
    <meta name="author" content="My name" /><title>
    Cheat Sheet War Blog | Providing fantasy football player rankings and strategy advice in support of our custom cheat sheet creation interface.
</title></head>
In qnotes.js, I added some JQuery to the top of the file which creates a dialog and this works, so JQuery appears to be loading (technically I don't think document.ready() would run without JQuery). Just not sure why it's choking on the on() method.
Dec 7, 2013 at 4:48 PM
What's in that second 01-jquery.js script entry?
<script type="text/javascript" src="/blog/Scripts/Auto/01-jquery.js"></script>
Dec 8, 2013 at 12:00 AM
Edited Dec 8, 2013 at 12:21 AM
I noticed that as well and just deleted the 01-jquery.js file (which was an old JQuery file) but unfortunately it didn't help. I think this was definitely the source of my JavaScript error. However, it didn't resolve my bigger problem that no posts are appearing on any page when I login as any user.

Let's go back and revisit the upgrade instructions, which to me are a bit confusing:
  1. Database Upgrade Script (for database installations)
    If you are upgrading from BlogEngine.NET 2.7, there are no upgrade scripts to run.
Is this supposed to read "If you are upgrading from BlogEngine.NET 2.6?" It seems to hint that an upgrade script is necessary if upgrading from version 2.6, but one is not provided in the /setup folder.
  1. Scripts folder
    Move scripts from /Scritps/Header to /Scripts/Auto
    Move scripts from /Scripts to /Scripts/Auto
I'm not sure the purpose of this step, but it is why I ended up with 2 JQuery references in the same folder, one from 1.9.1 (2.8 source) and another from 1.5.1 (the one from my existing installation). The older one ended up over-writing the newer which is what caused my JavaScript error. My /Script/Header folder contained the following files:
  • 01-jquery.js
  • blog.js
It looks like the blog.js resides in both /Script/Header and /Script/Auto. Are we supposed to override the one from the 2.8 source? Same with files in /Scripts. Are we supposed to override the ones in the 2.8 source? For instance, both contain "04-jquery-jtemplates.js".


Ultimately I'm past my script error but back to not seeing any posts when logged-in. Can someone point me in the direction of which portion of the code is responsible for adding the PostViews to the page?

Since I'm able to login, but can't see any posts or administration options, I'm wondering if this could be a role-related problem as well.

Thanks for your help Andy.
Dec 8, 2013 at 1:10 AM
Ding. Ding. Ding.

Did some role-based debugging and indeed the roles weren't being loaded. Configuring the role provider to use SQL was the one web.config step that I missed.

Thanks for the help guys.