U4-3943 - Preview stopped working after updating from 6.1.0 to 6.1.6

Created by Dima Stefantsov 28 Dec 2013, 03:52:37 Updated by Dima Stefantsov 31 Dec 2013, 11:35:38

I have made topic in your forums more than 2 weeks ago http://our.umbraco.org/forum/ourumb-dev-forum/bugs/46757-Preview-doesnt-work-after-updating-to-616-from-610 , but it looks like you are not reading your forums. I'll post my problem/bug here:

Hi. I've updated 6.1.0 to 6.1.6 (tried different settings here, even if I do no changes to configs - everything's same), and lost ability to '''Preview unpublished pages'''.

I'm getting null reference exceptions. @node.GetPropertyValue("uBlogsyContentTitle") which in fact does return Umbraco.Web.PublishedContentExtensions.GetPropertyValue(doc, alias, false); which, if I am not wrong, looks up published content from cache. Examine or something. In ExamineSettings.config both internal indexers have supportUnpublished="true" When node is created under 6.1.0, it can be previewed even in 6.1.6 (I think because it's in index already). But any unpublished node I create in 6.1.6 can not be previewed.

I think this is because Umbraco stopped filling the content cache with unpublished pages. Do you think you can help me somehow?

Comments

Sebastiaan Janssen 28 Dec 2013, 11:47:56

I can't reproduce this on a clean Umbraco install. Make sure that you've followed all of the upgrade instructions (specifically: merged all the config files). http://our.umbraco.org/documentation/installation/Upgrading/general


Dima Stefantsov 29 Dec 2013, 10:03:56

Thanks for looking into it, Sebastiaan. I have all files under git, I have just reverted 6.1.0 to 6.1.6 changes and performed all migration steps carefully again. Actually, I have separate git to keep default umbraco installs, I see every change that is happened between this versions, I applied every change manually this time. (kind of the way I described it a year ago here http://stefantsov.com/2013/may/updating-umbraco-cms)

I am 100% positive I have not missed any change that was introduced during 6.1.0 to 6.1.6. Previewing still doesn't work for me. Whatever was working, stopped working. Can you please give me some educated advice, how should I approach fixing this problem?

I have just installed clean 6.1.6 and at least I can reproduce '''a bug I have encountered while trying to solve my issue''': I create new Textpage under, lets say, Archive node (blog starter kit). Save it. Preview it. Preview works. Restart my webmatrix. Page that is unpublished is visible in live site interface. In admin UI it's still transparent, unpublished. Allright, atleast this piece of magic is not just on my installation, but on clean install as well.

I am using uBlogsy_Webforms_3.0.2.zip, http://our.umbraco.org/projects/starter-kits/ublogsy I have installed it on clean 6.1.6 and bingo, same issue as I have described. It is easy to reproduce, Sebastiaan. I will try to point uBlogsy developer to this bug, but it's your umbraco 6.1.0 to 6.1.6 breaking changes that made uBlogsy fail.

my code: @using uBlogsy.Common.Extensions; @using uHelpsy.Extensions @using uHelpsy.Helpers @using System.Text.RegularExpressions; @inherits umbraco.MacroEngines.DynamicNodeContext @{

// get seo keywords, use title when no keywords
var keywords = IPublishedContentHelper.GetNode((int)Model.Id).GetValueFirstOf(new[] { "uBlogsySeoKeywords" });
if (!string.IsNullOrEmpty(keywords))
{
    <meta name="keywords" content="@Regex.Replace(keywords, "[^А-Яа-яA-Za-z0-9,]", " ").Replace("  ", " ").Trim()" />
}

// get seo description, use body when no description
var description = IPublishedContentHelper.GetNode((int)Model.Id).GetValueFirstOf(new[] { "uBlogsySeoDescription" });
if (!string.IsNullOrEmpty(description))
{
    <meta name="description" content="@uBlogsy.Common.Extensions.StringExtensions.StripHtml(description).GetSummary(150).Trim()" />
}

@*<link rel="canonical" href="@(new Uri(Request.Url.AbsoluteUri).GetLeftPart(UriPartial.Path))"/> *@

}

my exception: Error loading MacroEngine script (file: /uBlogsy/uBlogsyGlobalSeoMeta.cshtml, Type: ''. Exception: System.NullReferenceException: Object reference not set to an instance of an object. at uHelpsy.Extensions.IPublishedContentExtensions.GetValueFirstOf(IPublishedContent d, String[] aliases) in D:_PROJECTS\Personal\uHelpsy - Library\uHelpsy\Source\uHelpsy.Web\Extensions\IPublishedContentExtensions.cs:line 20 at ASP._Page_macroScripts_uBlogsy_uBlogsyGlobalSeoMeta_cshtml.Execute() in c:_Programming!Sites_WebMatrix\stefantsov.com\stefantsov.com\MacroScripts\uBlogsy\uBlogsyGlobalSeoMeta.cshtml:line 9 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) at System.Web.WebPages.WebPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage) at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage) at umbraco.macro.loadMacroScript(MacroModel macro) at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)

clean umbraco + ublogsy exception: [NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Web.<>c__DisplayClassa1.b__a0(IPublishedContent node) +9 Umbraco.Web.PublishedContentExtensions.AncestorOrSelf(IPublishedContent content, Func`2 func) +20 Umbraco.Web.PublishedContentExtensions.AncestorOrSelf(IPublishedContent content, String nodeTypeAlias) +67 uBlogsy.BusinessLogic.DataService.GetLanding(IPublishedContent node) in d:_PROJECTS\Personal\uBlogsy\uBlogsy MVC\Source\uBlogsy.BusinessLogic\DataService.cs:109 uBlogsy.BusinessLogic.DataService.GetValueFromLanding(IPublishedContent node, String propertyAlias) in d:_PROJECTS\Personal\uBlogsy\uBlogsy MVC\Source\uBlogsy.BusinessLogic\DataService.cs:61 uBlogsy.WebForms.usercontrols.uCommentsy.Contact.OnLoad(EventArgs e) in D:_PROJECTS\Personal\uBlogsy\uBlogsy Webforms\Source\uBlogsy.WebForms\usercontrols\uCommentsy\Contact.ascx.cs:61 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772


Dima Stefantsov 30 Dec 2013, 14:18:51

EDIT: I must admit I have absolutely no idea how this magic works. I've been doing this debugging thing all day long, and it turns out even 6.1.0 doesn't work. It also turns out bug I mentioned in bold is not easy to reproduce. I hate magic. I will try more to finally figure out what is going on. For the moment I blame uBlogsy.


Dima Stefantsov 31 Dec 2013, 11:35:38

Update2: I have wrote this big post about my problems http://stefantsov.com/2013/december/umbracoublogsy-problems-and-questions But it looks like neither of issues I noticed are quite fit the title of this bug. My problems are not with Umbraco, but with uBlogsy, it uses non-default way to save and display data.


Priority: Normal

Type: Bug

State: Can't Reproduce

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: