Merge branch 'v7/dev' into v8/dev
# Conflicts: # build/Modules/Umbraco.Build/Get-UmbracoBuildEnv.ps1 # build/Modules/Umbraco.Build/Umbraco.Build.psm1 # build/NuSpecs/UmbracoCms.Core.nuspec # build/NuSpecs/UmbracoCms.nuspec # src/SQLCE4Umbraco/SqlCE4Umbraco.csproj # src/SQLCE4Umbraco/app.config # src/SolutionInfo.cs # src/Umbraco.Core/Configuration/UmbracoVersion.cs # src/Umbraco.Core/app.config # src/Umbraco.Core/packages.config # src/Umbraco.Tests.Benchmarks/app.config # src/Umbraco.Tests.Benchmarks/packages.config # src/Umbraco.Tests/App.config # src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs # src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs # src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs # src/Umbraco.Tests/packages.config # src/Umbraco.Web.UI.Client/bower.json # src/Umbraco.Web.UI.Client/package-lock.json # src/Umbraco.Web.UI/Properties/Settings.Designer.cs # src/Umbraco.Web.UI/config/imageprocessor/cache.config # src/Umbraco.Web.UI/config/imageprocessor/processing.config # src/Umbraco.Web.UI/packages.config # src/Umbraco.Web.UI/web.Template.Debug.config # src/Umbraco.Web.UI/web.Template.config # src/Umbraco.Web/Editors/ContentTypeControllerBase.cs # src/Umbraco.Web/Editors/EntityController.cs # src/Umbraco.Web/Editors/MediaController.cs # src/Umbraco.Web/Mvc/Strings.Designer.cs # src/Umbraco.Web/Properties/Settings1.Designer.cs # src/Umbraco.Web/Search/UmbracoTreeSearcher.cs # src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs # src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs # src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs # src/Umbraco.Web/app.config # src/Umbraco.Web/packages.config # src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs # src/UmbracoExamine/UmbracoExamine.csproj # src/UmbracoExamine/app.config # src/UmbracoExamine/packages.config # src/umbraco.MacroEngines/Resources/Strings.Designer.cs # src/umbraco.MacroEngines/app.config # src/umbraco.MacroEngines/packages.config # src/umbraco.MacroEngines/umbraco.MacroEngines.csproj # src/umbraco.businesslogic/app.config # src/umbraco.businesslogic/packages.config # src/umbraco.businesslogic/umbraco.businesslogic.csproj # src/umbraco.cms/app.config # src/umbraco.cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs # src/umbraco.cms/packages.config # src/umbraco.cms/umbraco.cms.csproj # src/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs # src/umbraco.controls/app.config # src/umbraco.controls/umbraco.controls.csproj # src/umbraco.datalayer/app.config # src/umbraco.datalayer/umbraco.datalayer.csproj # src/umbraco.editorControls/app.config # src/umbraco.editorControls/mediapicker/MediaChooserScripts.Designer.cs # src/umbraco.editorControls/umbraco.editorControls.csproj # src/umbraco.interfaces/umbraco.interfaces.csproj # src/umbraco.providers/app.config # src/umbraco.providers/umbraco.providers.csproj
This commit is contained in:
@@ -304,9 +304,12 @@ namespace Umbraco.Web.Editors
|
||||
//check if the type is trying to allow type 0 below itself - id zero refers to the currently unsaved type
|
||||
//always filter these 0 types out
|
||||
var allowItselfAsChild = false;
|
||||
var allowIfselfAsChildSortOrder = -1;
|
||||
if (contentTypeSave.AllowedContentTypes != null)
|
||||
{
|
||||
allowIfselfAsChildSortOrder = contentTypeSave.AllowedContentTypes.IndexOf(0);
|
||||
allowItselfAsChild = contentTypeSave.AllowedContentTypes.Any(x => x == 0);
|
||||
|
||||
contentTypeSave.AllowedContentTypes = contentTypeSave.AllowedContentTypes.Where(x => x > 0).ToList();
|
||||
}
|
||||
|
||||
@@ -335,10 +338,12 @@ namespace Umbraco.Web.Editors
|
||||
saveContentType(newCt);
|
||||
|
||||
//we need to save it twice to allow itself under itself.
|
||||
if (allowItselfAsChild)
|
||||
if (allowItselfAsChild && newCt != null)
|
||||
{
|
||||
//NOTE: This will throw if the composition isn't right... but it shouldn't be at this stage
|
||||
newCt.AddContentType(newCt);
|
||||
newCt.AllowedContentTypes =
|
||||
newCt.AllowedContentTypes.Union(
|
||||
new []{ new ContentTypeSort(newCt.Id, allowIfselfAsChildSortOrder) }
|
||||
);
|
||||
saveContentType(newCt);
|
||||
}
|
||||
return newCt;
|
||||
|
||||
Reference in New Issue
Block a user