Merge branch '6.0.7' into 6.1.2

Conflicts:
	src/Umbraco.Web/Media/ImageUrl.cs
	src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/MediaExtensions.cs
This commit is contained in:
Sebastiaan Janssen
2013-06-19 18:26:45 +02:00
15 changed files with 99 additions and 46 deletions

View File

@@ -333,7 +333,7 @@ namespace Umbraco.Core.Services
using (var repository = _repositoryFactory.CreateContentRepository(_uowProvider.GetUnitOfWork()))
{
var query = Query<IContent>.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);

View File

@@ -1035,5 +1035,34 @@ namespace Umbraco.Core
{
return ShortStringHelper.CleanStringForSafeFileName(text, culture);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="source">Current instance of the string</param>
/// <param name="oldString">Specified string to replace</param>
/// <param name="newString">Specified string to inject</param>
/// <param name="stringComparison">String Comparison object to specify search type</param>
/// <returns>Updated string</returns>
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;
}
}
}