Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #70 from umco/develop
Browse files Browse the repository at this point in the history
Preparing v2.0.4 release
  • Loading branch information
leekelleher authored May 10, 2019
2 parents b58abec + 1e063a7 commit 1226e84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: Visual Studio 2017

# version format
version: 2.0.3.{build}
version: 2.0.4.{build}

# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] JObject item, int pageId)
// Ensure PublishedContentRequest exists, just in case there are any RTE Macros to render
if (UmbracoContext.PublishedContentRequest == null)
{
var pageUrl = page.UrlAbsolute();

// If the page is unpublished, then the URL will be empty or a hash '#'.
// Use the current request as a fallback, as we need to give the PublishedContentRequest a URI.
if (string.IsNullOrEmpty(pageUrl) || pageUrl.Equals("#"))
{
pageUrl = string.Concat(Request.RequestUri.GetLeftPart(UriPartial.Authority), "/#", pageId);
}

#pragma warning disable CS0618 // Type or member is obsolete
var pcr = new PublishedContentRequest(new Uri(page.UrlAbsolute()), UmbracoContext.RoutingContext);
var pcr = new PublishedContentRequest(new Uri(pageUrl), UmbracoContext.RoutingContext);
#pragma warning restore CS0618 // Type or member is obsolete

UmbracoContext.PublishedContentRequest = pcr;
Expand Down

0 comments on commit 1226e84

Please sign in to comment.