diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs index a42f2d198e..4aac78a6e4 100644 --- a/src/Umbraco.Core/Constants-PropertyEditors.cs +++ b/src/Umbraco.Core/Constants-PropertyEditors.cs @@ -170,10 +170,16 @@ public static partial class Constants /// public const string TextArea = "Umbraco.TextArea"; + /// + /// Rich Text Editor. + /// + public const string RichText = "Umbraco.RichText"; + /// /// TinyMCE /// - public const string TinyMce = "Umbraco.TinyMCE"; + [Obsolete("Please use RichText constant instead, scheduled for removal in v16")] + public const string TinyMce = "Umbraco.RichText"; /// /// Boolean. diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/SimpleTinyMceValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/SimpleTinyMceValueConverter.cs index 8e0aa50acf..6d9c40e75c 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/SimpleTinyMceValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/SimpleTinyMceValueConverter.cs @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.PropertyEditors.ValueConverters; public class SimpleTinyMceValueConverter : PropertyValueConverterBase { public override bool IsConverter(IPublishedPropertyType propertyType) - => propertyType.EditorAlias == Constants.PropertyEditors.Aliases.TinyMce; + => propertyType.EditorAlias == Constants.PropertyEditors.Aliases.RichText; public override Type GetPropertyValueType(IPublishedPropertyType propertyType) => typeof(IHtmlEncodedString); diff --git a/src/Umbraco.Core/Services/ContentServiceExtensions.cs b/src/Umbraco.Core/Services/ContentServiceExtensions.cs index aaba622412..893a3eeaf5 100644 --- a/src/Umbraco.Core/Services/ContentServiceExtensions.cs +++ b/src/Umbraco.Core/Services/ContentServiceExtensions.cs @@ -17,7 +17,7 @@ public static class ContentServiceExtensions #region RTE Anchor values private static readonly Regex AnchorRegex = new(@"", RegexOptions.Compiled); - private static readonly string[] _propertyTypesWithRte = new[] { Constants.PropertyEditors.Aliases.TinyMce, Constants.PropertyEditors.Aliases.BlockList, Constants.PropertyEditors.Aliases.BlockGrid }; + private static readonly string[] _propertyTypesWithRte = new[] { Constants.PropertyEditors.Aliases.RichText, Constants.PropertyEditors.Aliases.BlockList, Constants.PropertyEditors.Aliases.BlockGrid }; public static IEnumerable? GetByIds(this IContentService contentService, IEnumerable ids) { diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs index d6bfd1d2dc..c52e6b8f25 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs @@ -1907,7 +1907,7 @@ internal class DatabaseDataCreator new DataTypeDto { NodeId = -87, - EditorAlias = Constants.PropertyEditors.Aliases.TinyMce, + EditorAlias = Constants.PropertyEditors.Aliases.RichText, DbType = "Ntext", Configuration = "{\"value\":\",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|\"}", diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs index 707976089f..a387f4d06d 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs @@ -1,6 +1,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_7_0; +using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade; @@ -96,11 +97,12 @@ public class UmbracoPlan : MigrationPlan To("{2D4C9FBD-08B3-472D-A76C-6ED467A0CD20}"); // To 14.0.0 - To("{419827A0-4FCE-464B-A8F3-247C6092AF55}"); - To("{5F15A1CC-353D-4889-8C7E-F303B4766196}"); - To("{69E12556-D9B3-493A-8E8A-65EC89FB658D}"); - To("{F2B16CD4-F181-4BEE-81C9-11CF384E6025}"); - To("{A8E01644-9F2E-4988-8341-587EF5B7EA69}"); - To("{E073DBC0-9E8E-4C92-8210-9CB18364F46E}"); + To("{419827A0-4FCE-464B-A8F3-247C6092AF55}"); + To("{5F15A1CC-353D-4889-8C7E-F303B4766196}"); + To("{69E12556-D9B3-493A-8E8A-65EC89FB658D}"); + To("{F2B16CD4-F181-4BEE-81C9-11CF384E6025}"); + To("{A8E01644-9F2E-4988-8341-587EF5B7EA69}"); + To("{E073DBC0-9E8E-4C92-8210-9CB18364F46E}"); + To("{80D282A4-5497-47FF-991F-BC0BCE603121}"); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddGuidsToUserGroups.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs similarity index 98% rename from src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddGuidsToUserGroups.cs rename to src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs index 79ab7d5d97..c481fc7694 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddGuidsToUserGroups.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs @@ -1,12 +1,11 @@ using NPoco; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations; using Umbraco.Cms.Infrastructure.Persistence.DatabaseModelDefinitions; using Umbraco.Cms.Infrastructure.Persistence.Dtos; using Umbraco.Cms.Infrastructure.Scoping; -namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_13_0_0; +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; public class AddGuidsToUserGroups : UnscopedMigrationBase { diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddGuidsToUsers.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs similarity index 98% rename from src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddGuidsToUsers.cs rename to src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs index 00f01599f5..ab7dccffea 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddGuidsToUsers.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUsers.cs @@ -1,12 +1,13 @@ using NPoco; using Umbraco.Cms.Core; +using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; using Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations; using Umbraco.Cms.Infrastructure.Persistence.DatabaseModelDefinitions; using Umbraco.Cms.Infrastructure.Persistence.Dtos; using Umbraco.Cms.Infrastructure.Scoping; using Umbraco.Extensions; -namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_13_0_0; +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; /// /// This is an unscoped migration to support migrating sqlite, since it doesn't support adding columns. diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddPropertyEditorUiAliasColumn.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddPropertyEditorUiAliasColumn.cs similarity index 89% rename from src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddPropertyEditorUiAliasColumn.cs rename to src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddPropertyEditorUiAliasColumn.cs index 43c432f0cc..7aaf4325cf 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddPropertyEditorUiAliasColumn.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddPropertyEditorUiAliasColumn.cs @@ -1,6 +1,6 @@ using Umbraco.Cms.Core; -namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_13_0_0; +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; public class AddPropertyEditorUiAliasColumn : MigrationBase { diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddUserGroupPermissionTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddUserGroupPermissionTable.cs similarity index 87% rename from src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddUserGroupPermissionTable.cs rename to src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddUserGroupPermissionTable.cs index 2510f32d65..9de1e3d083 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/AddUserGroupPermissionTable.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddUserGroupPermissionTable.cs @@ -1,7 +1,7 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Infrastructure.Persistence.Dtos; -namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_13_0_0; +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; public class AddUserGroup2PermisionTable : MigrationBase { diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/MigrateDataTypeConfigurations.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateDataTypeConfigurations.cs similarity index 98% rename from src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/MigrateDataTypeConfigurations.cs rename to src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateDataTypeConfigurations.cs index 3037497fe3..f221b657cf 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/MigrateDataTypeConfigurations.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateDataTypeConfigurations.cs @@ -9,7 +9,7 @@ using Umbraco.Cms.Infrastructure.Serialization; using Umbraco.Extensions; using PropertyEditorAliases = Umbraco.Cms.Core.Constants.PropertyEditors.Aliases; -namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_13_0_0; +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; public class MigrateDataTypeConfigurations : MigrationBase { diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/RenameTechnologyLeakingPropertyEditorAliases.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/RenameTechnologyLeakingPropertyEditorAliases.cs new file mode 100644 index 0000000000..04a26ab814 --- /dev/null +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/RenameTechnologyLeakingPropertyEditorAliases.cs @@ -0,0 +1,27 @@ +using Umbraco.Cms.Core; +using Umbraco.Cms.Infrastructure.Persistence.Dtos; + +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; + +public class RenameTechnologyLeakingPropertyEditorAliases : MigrationBase +{ + public RenameTechnologyLeakingPropertyEditorAliases(IMigrationContext context) : base(context) + { + } + + protected override void Migrate() + { + MigratePropertyEditorAlias("Umbraco.TinyMCE", Constants.PropertyEditors.Aliases.RichText); + } + + private void MigratePropertyEditorAlias(string propertyEditorAlias, string newAlias) + { + List propertyEditors = Database.Fetch().FindAll(x => x.EditorAlias == propertyEditorAlias); + + foreach (DataTypeDto propertyEditor in propertyEditors) + { + propertyEditor.EditorAlias = newAlias; + Database.Update(propertyEditor); + } + } +} diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/UpdateDefaultGuidsOfCreatedPackages.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/UpdateDefaultGuidsOfCreatedPackages.cs similarity index 95% rename from src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/UpdateDefaultGuidsOfCreatedPackages.cs rename to src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/UpdateDefaultGuidsOfCreatedPackages.cs index 93ec0c4b62..cea4080cdd 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_13_0_0/UpdateDefaultGuidsOfCreatedPackages.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/UpdateDefaultGuidsOfCreatedPackages.cs @@ -2,7 +2,7 @@ using System.Xml.Linq; using Umbraco.Cms.Core.Packaging; using Umbraco.Cms.Infrastructure.Persistence.Dtos; -namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_13_0_0; +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_14_0_0; public class UpdateDefaultGuidsOfCreatedPackages : MigrationBase { diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs index eda61b80c5..064b8386bf 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs @@ -14,7 +14,7 @@ public class RenameLabelAndRichTextPropertyEditorAliases : MigrationBase protected override void Migrate() { - MigratePropertyEditorAlias("Umbraco.TinyMCEv3", Constants.PropertyEditors.Aliases.TinyMce); + MigratePropertyEditorAlias("Umbraco.TinyMCEv3", Constants.PropertyEditors.Aliases.RichText); MigratePropertyEditorAlias("Umbraco.NoEdit", Constants.PropertyEditors.Aliases.Label); } diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs index 04656e03ef..1b7dd0141f 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Core.PropertyEditors; /// Represents a rich text property editor. /// [DataEditor( - Constants.PropertyEditors.Aliases.TinyMce, + Constants.PropertyEditors.Aliases.RichText, "Rich Text Editor", "rte", ValueType = ValueTypes.Text, diff --git a/src/Umbraco.Web.BackOffice/Controllers/BlockGridSampleHelper.cs b/src/Umbraco.Web.BackOffice/Controllers/BlockGridSampleHelper.cs index 44030cdaf0..034f9524d2 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BlockGridSampleHelper.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BlockGridSampleHelper.cs @@ -210,7 +210,7 @@ public sealed class BlockGridSampleHelper IDataType[] dataTypes = _dataTypeService.GetAll().OrderBy(d => d.Id).ToArray(); textBox = dataTypes.FirstOrDefault(d => d.EditorAlias == Constants.PropertyEditors.Aliases.TextBox); - tinyMce = dataTypes.FirstOrDefault(d => d.EditorAlias == Constants.PropertyEditors.Aliases.TinyMce); + tinyMce = dataTypes.FirstOrDefault(d => d.EditorAlias == Constants.PropertyEditors.Aliases.RichText); mediaPicker = dataTypes.Where(d => d.EditorAlias == Constants.PropertyEditors.Aliases.MediaPicker3 && d.ConfigurationAs()?.Multiple == false) diff --git a/tests/Umbraco.TestData/UmbracoTestDataController.cs b/tests/Umbraco.TestData/UmbracoTestDataController.cs index f2b7eb0f94..37c9b28ab4 100644 --- a/tests/Umbraco.TestData/UmbracoTestDataController.cs +++ b/tests/Umbraco.TestData/UmbracoTestDataController.cs @@ -282,7 +282,7 @@ public class UmbracoTestDataController : SurfaceController } private IDataType GetOrCreateRichText() => - GetOrCreateDataType(RichTextDataTypeName, Constants.PropertyEditors.Aliases.TinyMce); + GetOrCreateDataType(RichTextDataTypeName, Constants.PropertyEditors.Aliases.RichText); private IDataType GetOrCreateMediaPicker() => GetOrCreateDataType(MediaPickerDataTypeName, Constants.PropertyEditors.Aliases.MediaPicker); diff --git a/tests/Umbraco.Tests.Common/Builders/ContentTypeBuilder.cs b/tests/Umbraco.Tests.Common/Builders/ContentTypeBuilder.cs index f86cb7d5cf..283b3df773 100644 --- a/tests/Umbraco.Tests.Common/Builders/ContentTypeBuilder.cs +++ b/tests/Umbraco.Tests.Common/Builders/ContentTypeBuilder.cs @@ -228,7 +228,7 @@ public class ContentTypeBuilder .WithLabelOnTop(true) .Done() .AddPropertyType() - .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.TinyMce) + .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.RichText) .WithValueStorageType(ValueStorageType.Ntext) .WithAlias(RandomAlias("bodyText", randomizeAliases)) .WithName("Body text") @@ -292,7 +292,7 @@ public class ContentTypeBuilder .WithSortOrder(1) .Done() .AddPropertyType() - .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.TinyMce) + .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.RichText) .WithValueStorageType(ValueStorageType.Ntext) .WithAlias("bodyText") .WithName("Body text") @@ -400,7 +400,7 @@ public class ContentTypeBuilder .WithAlias("bodyText") .WithName("Body Text") .WithDataTypeId(Constants.DataTypes.RichtextEditor) - .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.TinyMce) + .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.RichText) .WithValueStorageType(ValueStorageType.Ntext) .WithSortOrder(3) .Done() diff --git a/tests/Umbraco.Tests.Common/Builders/MediaTypeBuilder.cs b/tests/Umbraco.Tests.Common/Builders/MediaTypeBuilder.cs index 7b5d4a97dc..d4ab24472a 100644 --- a/tests/Umbraco.Tests.Common/Builders/MediaTypeBuilder.cs +++ b/tests/Umbraco.Tests.Common/Builders/MediaTypeBuilder.cs @@ -150,7 +150,7 @@ public class MediaTypeBuilder .WithSortOrder(1) .Done() .AddPropertyType() - .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.TinyMce) + .WithPropertyEditorAlias(Constants.PropertyEditors.Aliases.RichText) .WithValueStorageType(ValueStorageType.Ntext) .WithAlias(RandomAlias("bodyText", randomizeAliases)) .WithName("Body text") diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs index cb502be992..47b39b3bfc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs @@ -62,7 +62,7 @@ public class IndexTest : ExamineBaseTest { Alias = "rte", Name = "RichText", - PropertyEditorAlias = Constants.PropertyEditors.Aliases.TinyMce + PropertyEditorAlias = Constants.PropertyEditors.Aliases.RichText }); var content = ContentBuilder.CreateBasicContent(contentType); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs index bb24410e7b..f7462f6408 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs @@ -380,7 +380,7 @@ public class ContentTypeServiceTests : UmbracoIntegrationTest "title") { Name = "Title", Description = string.Empty, Mandatory = false, DataTypeId = -88 }); contentType.AddPropertyType( - new PropertyType(ShortStringHelper, Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext, + new PropertyType(ShortStringHelper, Constants.PropertyEditors.Aliases.RichText, ValueStorageType.Ntext, "bodyText") { Name = "Body Text", Description = string.Empty, Mandatory = false, DataTypeId = -87 }); contentType.AddPropertyType(