Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7

This commit is contained in:
Shannon
2015-09-09 10:20:26 +02:00
2 changed files with 10 additions and 3 deletions

View File

@@ -1836,14 +1836,18 @@ namespace Umbraco.Core.Services
//Publish and then update the database with new status
var publishedOutcome = internalStrategy.PublishWithChildrenInternal(list, userId, includeUnpublished).ToArray();
var published = publishedOutcome
.Where(x => x.Success || x.Result.StatusType == PublishStatusType.SuccessAlreadyPublished)
// ensure proper order (for events) - cannot publish a child before its parent!
.OrderBy(x => x.Result.ContentItem.Level)
.ThenBy(x => x.Result.ContentItem.SortOrder);
var uow = UowProvider.GetUnitOfWork();
using (var repository = RepositoryFactory.CreateContentRepository(uow))
{
//NOTE The Publish with subpages-dialog was used more as a republish-type-thing, so we'll have to include PublishStatusType.SuccessAlreadyPublished
//in the updated-list, so the Published event is triggered with the expected set of pages and the xml is updated.
foreach (var item in publishedOutcome.Where(
x => x.Success || x.Result.StatusType == PublishStatusType.SuccessAlreadyPublished))
foreach (var item in published)
{
item.Result.ContentItem.WriterId = userId;
repository.AddOrUpdate(item.Result.ContentItem);

View File

@@ -22,7 +22,10 @@ angular.module("umbraco")
} else {
return val.slice(paddArray[0].length, 0);
}
}else{
} else {
if (paddArray[1].length === 0) {
return val.slice(paddArray[0].length);
}
return val.slice(paddArray[0].length, -paddArray[1].length);
}
}