From 5f825d624c16c78fda4eaf382fd7bbbdeabb9b2c Mon Sep 17 00:00:00 2001 From: Shandem Date: Thu, 29 Apr 2010 13:46:53 +0000 Subject: [PATCH] Fixes: 26782, 18390 [TFS Changeset #65842] --- umbraco/cms/businesslogic/web/Document.cs | 19 ++++++++++++++----- umbraco/presentation/publishingService.cs | 4 ++-- .../presentation/umbraco/dialogs/search.aspx | 8 ++++++-- .../umbraco/dialogs/search.aspx.designer.cs | 2 +- .../presentation/umbraco/editContent.aspx.cs | 11 +++++++++++ .../umbraco/xslt/searchResult.xslt | 2 +- 6 files changed, 35 insertions(+), 11 deletions(-) diff --git a/umbraco/cms/businesslogic/web/Document.cs b/umbraco/cms/businesslogic/web/Document.cs index 6198642358..51ac3cb0ed 100644 --- a/umbraco/cms/businesslogic/web/Document.cs +++ b/umbraco/cms/businesslogic/web/Document.cs @@ -1,3 +1,7 @@ +using System.Web.UI.WebControls; +using umbraco.cms.businesslogic.template; +using System.Web.UI; + using System; using System.Collections; using System.Data; @@ -218,7 +222,7 @@ namespace umbraco.cms.businesslogic.web private IEnumerable _children = null; // special for passing httpcontext object - private HttpContext _httpContext; + //private HttpContext _httpContext; // special for tree performance private int _userId = -1; @@ -268,6 +272,7 @@ namespace umbraco.cms.businesslogic.web // } //} + /// /// Gets a value indicating whether the document was constructed for the optimized mode /// @@ -312,17 +317,21 @@ namespace umbraco.cms.businesslogic.web get { return _writer; } } + + /// /// The current HTTPContext /// + [Obsolete("DO NOT USE THIS! Get the HttpContext via regular ASP.Net methods instead")] public HttpContext HttpContext { - set { _httpContext = value; } + set { /*THERE IS NO REASON TO DO THIS. _httpContext = value; */} get { - if (_httpContext == null) - _httpContext = HttpContext.Current; - return _httpContext; + //if (_httpContext == null) + // _httpContext = HttpContext.Current; + //return _httpContext; + return HttpContext.Current; } } diff --git a/umbraco/presentation/publishingService.cs b/umbraco/presentation/publishingService.cs index 92543983a6..29da96b712 100644 --- a/umbraco/presentation/publishingService.cs +++ b/umbraco/presentation/publishingService.cs @@ -33,7 +33,7 @@ namespace umbraco.presentation { try { - d.HttpContext = (HttpContext)sender; + //d.HttpContext = (HttpContext)sender; d.ReleaseDate = DateTime.MinValue; //new DateTime(1, 1, 1); // Causes release date to be null @@ -52,7 +52,7 @@ namespace umbraco.presentation } foreach(Document d in Document.GetDocumentsForExpiration()) { - d.HttpContext = (HttpContext)sender; + //d.HttpContext = (HttpContext)sender; //d.Published = false; library.UnPublishSingleNode(d.Id); } diff --git a/umbraco/presentation/umbraco/dialogs/search.aspx b/umbraco/presentation/umbraco/dialogs/search.aspx index 7482bfeb69..27378ebe3f 100644 --- a/umbraco/presentation/umbraco/dialogs/search.aspx +++ b/umbraco/presentation/umbraco/dialogs/search.aspx @@ -4,8 +4,12 @@ <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> diff --git a/umbraco/presentation/umbraco/dialogs/search.aspx.designer.cs b/umbraco/presentation/umbraco/dialogs/search.aspx.designer.cs index f742449449..ad8688796e 100644 --- a/umbraco/presentation/umbraco/dialogs/search.aspx.designer.cs +++ b/umbraco/presentation/umbraco/dialogs/search.aspx.designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4200 +// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/umbraco/presentation/umbraco/editContent.aspx.cs b/umbraco/presentation/umbraco/editContent.aspx.cs index 8649361c98..e8e477264e 100644 --- a/umbraco/presentation/umbraco/editContent.aspx.cs +++ b/umbraco/presentation/umbraco/editContent.aspx.cs @@ -67,6 +67,17 @@ namespace umbraco.cms.presentation //_document = new cms.businesslogic.web.Document(int.Parse(Request.QueryString["id"])); _document = new Document(true, id); + + //check if the doc exists + if (string.IsNullOrEmpty(_document.Path)) + { + //if this is invalid show an error + this.DisplayFatalError("No document found with id " + m_ContentId); + //reset the content id to null so processing doesn't continue on OnLoad + m_ContentId = null; + return; + } + // we need to check if there's a published version of this document _documentHasPublishedVersion = _document.HasPublishedVersion(); diff --git a/umbraco/presentation/umbraco/xslt/searchResult.xslt b/umbraco/presentation/umbraco/xslt/searchResult.xslt index 6a40fcff49..b956020ab0 100644 --- a/umbraco/presentation/umbraco/xslt/searchResult.xslt +++ b/umbraco/presentation/umbraco/xslt/searchResult.xslt @@ -9,7 +9,7 @@
  • - +