Merge branch 'v8/dev' into v8-feature-nc-copy-all
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Umbraco.Core.Services.Changes
|
||||
{
|
||||
internal static class TreeChangeExtensions
|
||||
public static class TreeChangeExtensions
|
||||
{
|
||||
public static TreeChange<TItem>.EventArgs ToEventArgs<TItem>(this IEnumerable<TreeChange<TItem>> changes)
|
||||
internal static TreeChange<TItem>.EventArgs ToEventArgs<TItem>(this IEnumerable<TreeChange<TItem>> changes)
|
||||
{
|
||||
return new TreeChange<TItem>.EventArgs(changes);
|
||||
}
|
||||
|
||||
@@ -1695,12 +1695,11 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
const int pageSize = 500;
|
||||
var page = 0;
|
||||
var total = long.MaxValue;
|
||||
while (page * pageSize < total)
|
||||
while (total > 0)
|
||||
{
|
||||
//get descendants - ordered from deepest to shallowest
|
||||
var descendants = GetPagedDescendants(content.Id, page, pageSize, out total, ordering: Ordering.By("Path", Direction.Descending));
|
||||
var descendants = GetPagedDescendants(content.Id, 0, pageSize, out total, ordering: Ordering.By("Path", Direction.Descending));
|
||||
foreach (var c in descendants)
|
||||
DoDelete(c);
|
||||
}
|
||||
@@ -1926,11 +1925,10 @@ namespace Umbraco.Core.Services.Implement
|
||||
paths[content.Id] = (parent == null ? (parentId == Constants.System.RecycleBinContent ? "-1,-20" : Constants.System.RootString) : parent.Path) + "," + content.Id;
|
||||
|
||||
const int pageSize = 500;
|
||||
var page = 0;
|
||||
var total = long.MaxValue;
|
||||
while (page * pageSize < total)
|
||||
while (total > 0)
|
||||
{
|
||||
var descendants = GetPagedDescendantsLocked(originalPath, page++, pageSize, out total, null, Ordering.By("Path", Direction.Ascending));
|
||||
var descendants = GetPagedDescendantsLocked(originalPath, 0, pageSize, out total, null, Ordering.By("Path", Direction.Ascending));
|
||||
foreach (var descendant in descendants)
|
||||
{
|
||||
moves.Add(Tuple.Create(descendant, descendant.Path)); // capture original path
|
||||
|
||||
+8
-8
@@ -229,11 +229,9 @@ function umbTreeDirective($q, $rootScope, treeService, notificationsService, use
|
||||
}
|
||||
|
||||
/** Method to load in the tree data */
|
||||
|
||||
function loadTree() {
|
||||
if (!$scope.loading && $scope.section) {
|
||||
$scope.loading = true;
|
||||
|
||||
if ($scope.section) {
|
||||
|
||||
//default args
|
||||
var args = { section: $scope.section, tree: $scope.treealias, cacheKey: $scope.cachekey, isDialog: $scope.isdialog ? $scope.isdialog : false };
|
||||
|
||||
@@ -244,20 +242,22 @@ function umbTreeDirective($q, $rootScope, treeService, notificationsService, use
|
||||
|
||||
return treeService.getTree(args)
|
||||
.then(function (data) {
|
||||
|
||||
//Only use the tree data, if we are still on the correct section
|
||||
if(data.alias !== $scope.section){
|
||||
return $q.reject();
|
||||
}
|
||||
|
||||
//set the data once we have it
|
||||
$scope.tree = data;
|
||||
|
||||
$scope.loading = false;
|
||||
|
||||
//set the root as the current active tree
|
||||
$scope.activeTree = $scope.tree.root;
|
||||
|
||||
emitEvent("treeLoaded", { tree: $scope.tree });
|
||||
emitEvent("treeNodeExpanded", { tree: $scope.tree, node: $scope.tree.root, children: $scope.tree.root.children });
|
||||
|
||||
return $q.when(data);
|
||||
}, function (reason) {
|
||||
$scope.loading = false;
|
||||
notificationsService.error("Tree Error", reason);
|
||||
return $q.reject(reason);
|
||||
});
|
||||
|
||||
@@ -63,7 +63,7 @@ angular.module('umbraco.services').factory("editorState", function ($rootScope)
|
||||
*/
|
||||
getCurrent: function () {
|
||||
return current;
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@ namespace Umbraco.Web.Runtime
|
||||
|
||||
// we should stop injecting UmbracoContext and always inject IUmbracoContextAccessor, however at the moment
|
||||
// there are tons of places (controllers...) which require UmbracoContext in their ctor - so let's register
|
||||
// a way to inject the UmbracoContext - and register it per-request to be more efficient
|
||||
// TODO: stop doing this
|
||||
composition.Register(factory => factory.GetInstance<IUmbracoContextAccessor>().UmbracoContext, Lifetime.Request);
|
||||
// a way to inject the UmbracoContext - DO NOT register this as Lifetime.Request since LI will dispose the context
|
||||
// in it's own way but we don't want that to happen, we manage its lifetime ourselves.
|
||||
composition.Register(factory => factory.GetInstance<IUmbracoContextAccessor>().UmbracoContext);
|
||||
|
||||
composition.Register<IPublishedContentQuery>(factory =>
|
||||
{
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace Umbraco.Web
|
||||
public static class UrlHelperRenderExtensions
|
||||
{
|
||||
|
||||
private static readonly IHtmlString EmptyHtmlString = new HtmlString(string.Empty);
|
||||
|
||||
#region GetCropUrl
|
||||
|
||||
/// <summary>
|
||||
@@ -39,6 +41,8 @@ namespace Umbraco.Web
|
||||
/// <returns></returns>
|
||||
public static IHtmlString GetCropUrl(this UrlHelper urlHelper, IPublishedContent mediaItem, string cropAlias, bool htmlEncode = true)
|
||||
{
|
||||
if (mediaItem == null) return EmptyHtmlString;
|
||||
|
||||
var url = mediaItem.GetCropUrl(cropAlias: cropAlias, useCropDimensions: true);
|
||||
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
|
||||
}
|
||||
@@ -65,6 +69,8 @@ namespace Umbraco.Web
|
||||
/// </returns>
|
||||
public static IHtmlString GetCropUrl(this UrlHelper urlHelper, IPublishedContent mediaItem, string propertyAlias, string cropAlias, bool htmlEncode = true)
|
||||
{
|
||||
if (mediaItem == null) return EmptyHtmlString;
|
||||
|
||||
var url = mediaItem.GetCropUrl(propertyAlias: propertyAlias, cropAlias: cropAlias, useCropDimensions: true);
|
||||
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
|
||||
}
|
||||
@@ -144,6 +150,8 @@ namespace Umbraco.Web
|
||||
bool upScale = true,
|
||||
bool htmlEncode = true)
|
||||
{
|
||||
if (mediaItem == null) return EmptyHtmlString;
|
||||
|
||||
var url = mediaItem.GetCropUrl(width, height, propertyAlias, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBuster, furtherOptions, ratioMode,
|
||||
upScale);
|
||||
@@ -247,6 +255,8 @@ namespace Umbraco.Web
|
||||
bool upScale = true,
|
||||
bool htmlEncode = true)
|
||||
{
|
||||
if (imageCropperValue == null) return EmptyHtmlString;
|
||||
|
||||
var imageUrl = imageCropperValue.Src;
|
||||
var url = imageUrl.GetCropUrl(imageCropperValue, width, height, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode,
|
||||
|
||||
Reference in New Issue
Block a user