diff --git a/Composite.Workflows/Plugins/Elements/ElementProviders/PageElementProvider/AddNewPageWorkflow.cs b/Composite.Workflows/Plugins/Elements/ElementProviders/PageElementProvider/AddNewPageWorkflow.cs index 60a9add2d4..9ee726897f 100644 --- a/Composite.Workflows/Plugins/Elements/ElementProviders/PageElementProvider/AddNewPageWorkflow.cs +++ b/Composite.Workflows/Plugins/Elements/ElementProviders/PageElementProvider/AddNewPageWorkflow.cs @@ -436,9 +436,12 @@ private void PrepareStep2_ExecuteCode(object sender, EventArgs e) if (this.GetBinding("SelectedSortOrder") == "Relative") { - var existingPages = - (from page in PageServices.GetChildren(GetParentId()) - select new { Title = page.Title, Id = page.Id }).ToList(); + var existingPages = new Dictionary(); + + foreach (IPage page in PageServices.GetChildren(GetParentId())) + { + existingPages.Add(page.Id, page.Title); + } if (this.BindingExist("ExistingPages") == false) { @@ -451,11 +454,11 @@ private void PrepareStep2_ExecuteCode(object sender, EventArgs e) if (this.BindingExist("RelativeSelectedPageId") == false) { - this.Bindings.Add("RelativeSelectedPageId", existingPages[0].Id); + this.Bindings.Add("RelativeSelectedPageId", existingPages.First().Key); } else { - this.Bindings["RelativeSelectedPageId"] = existingPages[0].Id; + this.Bindings["RelativeSelectedPageId"] = existingPages.First().Key; } } else diff --git a/Website/Composite/content/forms/Administrative/AddNewPageStep2.xml b/Website/Composite/content/forms/Administrative/AddNewPageStep2.xml index 26cb4d2884..06fb1442e3 100644 --- a/Website/Composite/content/forms/Administrative/AddNewPageStep2.xml +++ b/Website/Composite/content/forms/Administrative/AddNewPageStep2.xml @@ -2,7 +2,7 @@ - + @@ -29,7 +29,7 @@ - +