From 806fce8ed90822d2c68aea8e2d7ba89d29ecaa29 Mon Sep 17 00:00:00 2001 From: Mole Date: Mon, 27 May 2024 14:10:19 +0200 Subject: [PATCH] Add editor ui alias to package xml (#16420) * Add editor ui alias to package xml * Update src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs * Add AllowAtRoot and AllowInAreas --------- Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> --- src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs | 4 ++++ src/Umbraco.Core/Services/EntityXmlSerializer.cs | 1 + .../Packaging/PackageDataInstallation.cs | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs b/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs index d628537ab3..ade1da8b8a 100644 --- a/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs +++ b/src/Umbraco.Core/PropertyEditors/BlockGridConfiguration.cs @@ -26,6 +26,10 @@ public class BlockGridConfiguration public Guid ContentElementTypeKey { get; set; } public Guid? SettingsElementTypeKey { get; set; } + + public bool AllowAtRoot { get; set; } + + public bool AllowInAreas { get; set; } } public class NumberRange diff --git a/src/Umbraco.Core/Services/EntityXmlSerializer.cs b/src/Umbraco.Core/Services/EntityXmlSerializer.cs index b22fcfd46e..872b6b6868 100644 --- a/src/Umbraco.Core/Services/EntityXmlSerializer.cs +++ b/src/Umbraco.Core/Services/EntityXmlSerializer.cs @@ -211,6 +211,7 @@ internal class EntityXmlSerializer : IEntityXmlSerializer // The 'ID' when exporting is actually the property editor alias (in pre v7 it was the IDataType GUID id) xml.Add(new XAttribute("Id", dataType.EditorAlias)); + xml.Add(new XAttribute("EditorUiAlias", dataType.EditorUiAlias ?? dataType.EditorAlias)); xml.Add(new XAttribute("Definition", dataType.Key)); xml.Add(new XAttribute("DatabaseType", dataType.DatabaseType.ToString())); xml.Add(new XAttribute("Configuration", _configurationEditorJsonSerializer.Serialize(dataType.ConfigurationObject))); diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index 32be1b1cc1..a6c3ea453e 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs @@ -1257,12 +1257,15 @@ namespace Umbraco.Cms.Infrastructure.Packaging editor = new VoidEditor(_dataValueEditorFactory) {Alias = editorAlias ?? string.Empty}; } + var editorUiAlias = dataTypeElement.Attribute("EditorUiAlias")?.Value?.Trim() ?? editorAlias; + var dataType = new DataType(editor, _serializer) { Key = dataTypeDefinitionId, Name = dataTypeDefinitionName, DatabaseType = databaseType, - ParentId = parentId + ParentId = parentId, + EditorUiAlias = editorUiAlias, }; var configurationAttributeValue = dataTypeElement.Attribute("Configuration")?.Value;