diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 3c0ff63633..bce028a7d3 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -333,7 +333,7 @@ namespace Umbraco.Core.Services using (var repository = _repositoryFactory.CreateContentRepository(_uowProvider.GetUnitOfWork())) { var query = Query.Builder.Where(x => x.ParentId == id); - var contents = repository.GetByQuery(query); + var contents = repository.GetByQuery(query).OrderBy(x => x.SortOrder); return contents; } @@ -1114,7 +1114,7 @@ namespace Umbraco.Core.Services } //Look for children and copy those as well - var children = GetChildren(content.Id).OrderBy(x => x.SortOrder); + var children = GetChildren(content.Id); foreach (var child in children) { Copy(child, copy.Id, relateToOriginal, userId); diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index 9a56fe87b0..33a5730444 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -1035,5 +1035,34 @@ namespace Umbraco.Core { return ShortStringHelper.CleanStringForSafeFileName(text, culture); } + + /// + /// An extension method that returns a new string in which all occurrences of a + /// specified string in the current instance are replaced with another specified string. + /// StringComparison specifies the type of search to use for the specified string. + /// + /// Current instance of the string + /// Specified string to replace + /// Specified string to inject + /// String Comparison object to specify search type + /// Updated string + public static string Replace(this string source, string oldString, string newString, StringComparison stringComparison) + { + var index = source.IndexOf(oldString, stringComparison); + + // Determine if we found a match + var matchFound = index >= 0; + + if (matchFound) + { + // Remove the old text + source = source.Remove(index, oldString.Length); + + // Add the replacemenet text + source = source.Insert(index, newString); + } + + return source; + } } } diff --git a/src/Umbraco.Web.UI/umbraco/create/content.ascx b/src/Umbraco.Web.UI/umbraco/create/content.ascx index da1a385f02..47ea26143d 100644 --- a/src/Umbraco.Web.UI/umbraco/create/content.ascx +++ b/src/Umbraco.Web.UI/umbraco/create/content.ascx @@ -18,7 +18,7 @@
- or + <%= umbraco.ui.Text("or") %> <%=umbraco.ui.Text("cancel")%>