Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Jun 21, 2016 @ 05:04
    Nathan Woulfe
    0

    Previewing new/unpublished content

    Is it possible to preview a node before it has been published? When I try to do so, the preview renders our 404 page.

    Makes sense (to me, at least) that an editor should be able to preview a new page prior to publishing?

    Site is on 7.4.2.

  • Amalie Wowern 144 posts 273 karma points MVP c-trib
    Jun 21, 2016 @ 06:59
    Amalie Wowern
    0

    Hi

    Have you saved the node first? If you save the node first the prewiev button should be showing and it should work.?

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Jun 21, 2016 @ 07:52
    Nathan Woulfe
    0

    Hi Amalie

    Yup, absolutely saved the node - no preview button until it's saved, but preview returns a 404 until the node has been published.

    It's odd.

    N

  • Amalie Wowern 144 posts 273 karma points MVP c-trib
    Jun 21, 2016 @ 07:54
    Amalie Wowern
    0

    Have you assigned the node a template?

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Jun 21, 2016 @ 08:05
    Nathan Woulfe
    0

    Sure have. It's an existing site, in the process of upgrading from 7.1.2. Need to check that it's not an issue on 7.1.2, but haven't had any of our users mention it.

  • Alastair Todd 44 posts 142 karma points
    Jun 23, 2016 @ 18:21
    Alastair Todd
    0

    I have this exact same issue in a Live environment.

    Some unpublished docs under the same node are fine whilst others are not.

    All I have to go on in the Logs is:

    WARN Umbraco.Web.UmbracoModule - Status code is 404 yet TrySkipIisCustomErrors is false - IIS will take over.

    How do you go about debugging that?

  • Danny dineen 17 posts 96 karma points
    Sep 22, 2017 @ 02:23
    Danny dineen
    0

    I am having this same issue on 7.6.6. Preview works great once the page is published. I am using Umbraco as a multi-tenant headless CMS with Angular 2 ASP.NET core front ends. The front ends receive either IContent or IPublishedContent depending on whether one is previewing the site from Umbraco or not. All pages in Umbraco use the same template. This single template's purpose is to get the root node of whatever content is being previewed to extract some site configuration properties which help in generating the URL for a IFrame. It works great. Umbraco is fantastic!

    I can get Unpublished content from our extension project API in JSON, but in Umbraco, for example, umbraco/preview/?id=1475 (1475 being the unpublished node id) it returns 404.

    Also I can see the content in the app_Data/preview folder config file.

    Are there any updates to this issue?

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Sep 22, 2017 @ 07:12
    Nathan Woulfe
    1

    Hi Danny

    Are you by any chance using a custom Owin startup class?

    We resolved this by ensuring the Umbraco application was correctly configured for backoffice auth:

    public void Configuration(IAppBuilder app) {
    
           // other stuff
    
            app.UseUmbracoBackOfficeCookieAuthentication(ApplicationContext.Current)
               .UseUmbracoBackOfficeExternalCookieAuthentication(ApplicationContext.Current)
               .UseUmbracoPreviewAuthentication(ApplicationContext.Current, PipelineStage.Authorize);
    
        }
    
  • Danny dineen 17 posts 96 karma points
    Sep 22, 2017 @ 17:20
    Danny dineen
    0

    Hi Nathan,

    Thank you very much. That was it. In the web.config the App Setting - "owin:appStartup" was using umbracoStandardOwinStartup. This class did not have the lines you provided above. I added them and now previewing unpublished content works perfectly.

  • Danny dineen 17 posts 96 karma points
    Jun 27, 2018 @ 18:18
    Danny dineen
    0

    This started to happen again in version 7.10.0. It appears to redirecting to a 404 error, but the underlying reason I am unable to determine.

    Here is the content of the yellow .Net screen.

    Any ideas?

    Sequence contains no elements 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.InvalidOperationException: Sequence contains no elements

    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:

    [InvalidOperationException: Sequence contains no elements] System.Linq.Enumerable.First(IEnumerable`1 source) +264 Umbraco.Core.Configuration.UmbracoSettings.ContentErrorsElement.getError404Collection() +85 Umbraco.Core.Configuration.UmbracoSettings.ContentElement.getError404Collection() +17 Umbraco.Web.Routing.ContentFinderByLegacy404.TryFindContent(PublishedContentRequest pcr) +467 Umbraco.Web.Routing.ContentLastChanceFinderByNotFoundHandlers.HandlePageNotFound(PublishedContentRequest docRequest) +424 Umbraco.Web.Routing.ContentLastChanceFinderByNotFoundHandlers.TryFindContent(PublishedContentRequest docRequest) +10 Umbraco.Web.Routing.PublishedContentRequestEngine.HandlePublishedContent() +592 Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContentAndTemplate() +283 Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +107 Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +379 Umbraco.Web.UmbracoModule.

  • Danny dineen 17 posts 96 karma points
    Jul 04, 2018 @ 00:21
    Danny dineen
    0

    I followed the comments provided in - https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs //Ensure owin is configured for Umbraco back office authentication. If you have any front-end OWIN // cookie configuration, this must be declared after it.

    //set up the token first app.UseUmbracoBackOfficeTokenAuth();

    //then configure the service app .UseUmbracoBackOfficeCookieAuthentication(ApplicationContext, PipelineStage.Authenticate) .UseUmbracoBackOfficeExternalCookieAuthentication(ApplicationContext, PipelineStage.Authenticate) .UseUmbracoPreviewAuthentication(ApplicationContext, PipelineStage.Authorize) .FinalizeMiddlewareConfiguration();

Please Sign in or register to post replies

Write your reply to:

Draft