Fixes: U4-4427 Exception with selecting content start node in Multi-node tree picker 6.2.0

This commit is contained in:
Shannon
2014-03-17 13:12:08 +11:00
parent bbeedb6c1b
commit d1d54d8e84
3 changed files with 12 additions and 8 deletions

View File

@@ -21,10 +21,14 @@ namespace umbraco.dialogs
TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService();
DataBind();
if(Request.QueryString["selected"] != null && TreeParams.TreeType == "content") {
if(Request.QueryString["selected"] != null && TreeParams.TreeType == "content")
{
var currContent = Services.ContentService.GetById(int.Parse(Request.QueryString["selected"]));
if (currContent.ParentId > 0)
DialogTree.SelectedNodePath = currContent.Path;
if (currContent != null)
{
if (currContent.ParentId > 0)
DialogTree.SelectedNodePath = currContent.Path;
}
}
}

View File

@@ -13,9 +13,9 @@ namespace umbraco.uicontrols.TreePicker
{
get
{
if (HttpContext.Current != null && HttpContext.Current.Request.QueryString["id"] != null)
if ( Context.Request.QueryString["id"] != null)
{
return TreeUrlGenerator.GetPickerUrl(Constants.Applications.Content, "content") + "&selected=" + HttpContext.Current.Request.QueryString["id"];
return TreeUrlGenerator.GetPickerUrl(Constants.Applications.Content, "content") + "&selected=" + Context.Request.QueryString["id"];
}

View File

@@ -22,15 +22,15 @@ namespace umbraco.editorControls
{
public pagePicker() : base() { }
public pagePicker(interfaces.IData data) : base(data) { }
public pagePicker(IData data) : base(data) { }
public override string TreePickerUrl
{
get
{
if (HttpContext.Current != null && HttpContext.Current.Request.QueryString["id"] != null)
if (Context.Request.QueryString["id"] != null)
{
return TreeUrlGenerator.GetPickerUrl(Umbraco.Core.Constants.Applications.Content, "content") + "&selected=" + HttpContext.Current.Request.QueryString["id"];
return TreeUrlGenerator.GetPickerUrl(Umbraco.Core.Constants.Applications.Content, "content") + "&selected=" + Context.Request.QueryString["id"];
}
return TreeUrlGenerator.GetPickerUrl(Umbraco.Core.Constants.Applications.Content, "content");