Skip move logic if the parent is staying the same (#12937)
* v10/feature/skip-move-logic: add logic to skip move logic when parentId would be the same as before * v10/feature/skip-move-logic: remove unnecessary checks * remove check for mediaservice as there is already one in place * remove unnecessary using * added parent checks for dictionary items * changing behaviour for contenttypes, datatypes and mediatypes to show errors on move
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user