From 44caa0cf057a5b9bd57c7c17c31ea21303f54b77 Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Wed, 14 Jul 2021 10:31:58 +0200 Subject: [PATCH] Obsolete AddPropertyGroup without specifying alias --- src/Umbraco.Core/Models/ContentTypeBase.cs | 22 ++++--------------- .../Models/ContentTypeCompositionBase.cs | 5 +++-- src/Umbraco.Core/Models/IContentTypeBase.cs | 7 +++--- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/Umbraco.Core/Models/ContentTypeBase.cs b/src/Umbraco.Core/Models/ContentTypeBase.cs index e2dcfce756..ef5eb3dfc3 100644 --- a/src/Umbraco.Core/Models/ContentTypeBase.cs +++ b/src/Umbraco.Core/Models/ContentTypeBase.cs @@ -297,26 +297,12 @@ namespace Umbraco.Core.Models /// Returns True if a PropertyType with the passed in alias exists, otherwise False public abstract bool PropertyTypeExists(string propertyTypeAlias); - /// - /// Adds a property group with the alias based on the name. - /// This method will also check if a group already exists with the same alias. - /// - /// Name of the PropertyGroup to add - /// - /// Returns True if a PropertyGroup with the passed in name was added, otherwise False - /// + /// + [Obsolete("Use AddPropertyGroup(name, alias) instead to explicitly set the alias.")] public abstract bool AddPropertyGroup(string groupName); - /// - /// Adds a PropertyGroup. - /// This method will also check if a group already exists with the same name and link it to the parent. - /// - /// Name of the PropertyGroup to add - /// The alias. - /// - /// Returns True if a PropertyGroup with the passed in name was added, otherwise False - /// - public abstract bool AddPropertyGroup(string groupName, string alias); + /// + public abstract bool AddPropertyGroup(string name, string alias); /// /// Adds a PropertyType to a specific PropertyGroup diff --git a/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs b/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs index 26150c0eae..67ec52a8b0 100644 --- a/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs +++ b/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs @@ -206,15 +206,16 @@ namespace Umbraco.Core.Models } /// + [Obsolete("Use AddPropertyGroup(name, alias) instead to explicitly set the alias.")] public override bool AddPropertyGroup(string groupName) { return AddAndReturnPropertyGroup(groupName, groupName.ToSafeAlias(true)) != null; } /// - public override bool AddPropertyGroup(string groupName, string alias) + public override bool AddPropertyGroup(string name, string alias) { - return AddAndReturnPropertyGroup(groupName, alias) != null; + return AddAndReturnPropertyGroup(name, alias) != null; } private PropertyGroup AddAndReturnPropertyGroup(string name, string alias) diff --git a/src/Umbraco.Core/Models/IContentTypeBase.cs b/src/Umbraco.Core/Models/IContentTypeBase.cs index 4570202bc7..c489139970 100644 --- a/src/Umbraco.Core/Models/IContentTypeBase.cs +++ b/src/Umbraco.Core/Models/IContentTypeBase.cs @@ -154,12 +154,13 @@ namespace Umbraco.Core.Models /// /// This method will also check if a group already exists with the same alias. /// + [Obsolete("Use AddPropertyGroup(name, alias) instead to explicitly set the alias.")] bool AddPropertyGroup(string groupName); /// - /// Adds a property group with the specified and . + /// Adds a property group with the specified and . /// - /// Name of the group. + /// Name of the group. /// The alias. /// /// Returns true if a property group with specified was added; otherwise, false. @@ -167,7 +168,7 @@ namespace Umbraco.Core.Models /// /// This method will also check if a group already exists with the same alias. /// - bool AddPropertyGroup(string groupName, string alias); + bool AddPropertyGroup(string name, string alias); /// /// Moves a PropertyType to a specified PropertyGroup