Merge branch 'v10/dev' into v11/dev
This commit is contained in:
@@ -383,6 +383,30 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult PostCopy(MoveOrCopy copy)
|
||||
{
|
||||
var toCopy = _dataTypeService.GetDataType(copy.Id);
|
||||
if (toCopy is null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
Attempt<OperationResult<MoveOperationStatusType, IDataType>?> result = _dataTypeService.Copy(toCopy, copy.ParentId);
|
||||
if (result.Success)
|
||||
{
|
||||
return Content(toCopy.Path, MediaTypeNames.Text.Plain, Encoding.UTF8);
|
||||
}
|
||||
|
||||
return result.Result?.Result switch
|
||||
{
|
||||
MoveOperationStatusType.FailedParentNotFound => NotFound(),
|
||||
MoveOperationStatusType.FailedCancelledByEvent => ValidationProblem(),
|
||||
MoveOperationStatusType.FailedNotAllowedByPath => ValidationProblem(
|
||||
_localizedTextService.Localize("moveOrCopy", "notAllowedByPath")),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
}
|
||||
|
||||
public IActionResult PostRenameContainer(int id, string name)
|
||||
{
|
||||
var currentUser = _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser;
|
||||
|
||||
@@ -260,6 +260,11 @@ public class DictionaryController : BackOfficeNotificationsController
|
||||
return ValidationProblem(_localizedTextService.Localize("dictionary", "itemDoesNotExists"));
|
||||
}
|
||||
|
||||
if(dictionaryItem.ParentId == null && move.ParentId == Constants.System.Root)
|
||||
{
|
||||
return ValidationProblem(_localizedTextService.Localize("moveOrCopy", "notAllowedByPath"));
|
||||
}
|
||||
|
||||
IDictionaryItem? parent = _localizationService.GetDictionaryItemById(move.ParentId);
|
||||
if (parent == null)
|
||||
{
|
||||
@@ -274,6 +279,11 @@ public class DictionaryController : BackOfficeNotificationsController
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dictionaryItem.ParentId == parent.Key)
|
||||
{
|
||||
return ValidationProblem(_localizedTextService.Localize("moveOrCopy", "notAllowedByPath"));
|
||||
}
|
||||
|
||||
dictionaryItem.ParentId = parent.Key;
|
||||
if (dictionaryItem.Key == parent.ParentId)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,8 @@ public class PublishedSnapshotCacheStatusController : UmbracoAuthorizedApiContro
|
||||
[HttpPost]
|
||||
public string RebuildDbCache()
|
||||
{
|
||||
_publishedSnapshotService.Rebuild();
|
||||
//Rebuild All
|
||||
_publishedSnapshotService.RebuildAll();
|
||||
return _publishedSnapshotStatus.GetStatus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user