diff --git a/src/Umbraco.Cms.Persistence.Sqlite/Services/SqliteDatabaseCreator.cs b/src/Umbraco.Cms.Persistence.Sqlite/Services/SqliteDatabaseCreator.cs
index 54d6063ad7..c666547c1d 100644
--- a/src/Umbraco.Cms.Persistence.Sqlite/Services/SqliteDatabaseCreator.cs
+++ b/src/Umbraco.Cms.Persistence.Sqlite/Services/SqliteDatabaseCreator.cs
@@ -69,7 +69,9 @@ public class SqliteDatabaseCreator : IDatabaseCreator
* always initializing in this way and it probably helps for non azure scenarios also (anytime persisting on a cifs mount for example).
*/
- var tempFile = Path.GetTempFileName();
+ // Create a random file name using cryptographically strong random number generator (RNGCryptoServiceProvider)
+ var tempFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+
var tempConnectionString = new SqliteConnectionStringBuilder { DataSource = tempFile, Pooling = false };
using (var connection = new SqliteConnection(tempConnectionString.ConnectionString))
diff --git a/src/Umbraco.Core/Constants-Conventions.cs b/src/Umbraco.Core/Constants-Conventions.cs
index 03240db872..7047e16437 100644
--- a/src/Umbraco.Core/Constants-Conventions.cs
+++ b/src/Umbraco.Core/Constants-Conventions.cs
@@ -276,7 +276,7 @@ public static partial class Constants
public const string RelateParentMediaFolderOnDeleteAlias = "relateParentMediaFolderOnDelete";
///
- /// Returns the types of relations that are automatically tracked
+ /// Returns the types of relations that are automatically tracked.
///
///
/// Developers should not manually use these relation types since they will all be cleared whenever an entity
@@ -284,7 +284,7 @@ public static partial class Constants
///
public static string[] AutomaticRelationTypes { get; } = { RelatedMediaAlias, RelatedDocumentAlias };
- // TODO: return a list of built in types so we can use that to prevent deletion in the uI
+ // TODO: return a list of built in types so we can use that to prevent deletion in the UI
}
public static class Udi
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml b/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml
index 29b242d67e..0057d3d9a6 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml
@@ -1194,7 +1194,6 @@
Vyberte verzi, kterou chcete porovnat s aktuální verzí
- Současná verzeČervený text nebude ve vybrané verzi zobrazen, zelený znamená přidaný].]]>Dokument byl vrácen na starší verziTohle zobrazuje vybranou verzi jako html, jestliže chcete vidět rozdíly mezi 2 verzemi najednou, použijte rozdílové zobrazení
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml b/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml
index e34cc2ab29..012a1bc0b9 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml
@@ -1523,8 +1523,6 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang
Dewis fersiwn i gymharu efo fersiwn bresennolNewidiadau
- Creuwyd
- Fersiwn bresennolNi fydd testun coch yn cael ei ddangos yn y fersiwn dewiswyd. , mae gwyrdd yn golygu wedi'i ychwanegu]]>Dogfen wedi'i rolio yn ôlMae hyn yn dangos y fersiwn dewiswyd ar ffurf HTML, os hoffwch weld y gwahaniaeth rhwng 2 fersiwn ar yr un pryd, defnyddiwch y wedd gwahaniaethol
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml
index 879a6b4a62..7fbc7d0b5b 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml
@@ -1238,11 +1238,10 @@ Mange hilsner fra Umbraco robotten
Ændringer
- OprettetVælg en version at sammenligne med den nuværende version
- Nuværende versionRød tekst vil ikke blive vist i den valgte version. Grøn betyder tilføjet]]>
+ Der er ingen forskelle mellem den nuværende version og den valgte versionDokument tilbagerulletHer vises den valgte version som html. Hvis du ønsker at se forskellen mellem de 2 versioner
på samme tid, brug 'diff'-oversigten
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/de.xml b/src/Umbraco.Core/EmbeddedResources/Lang/de.xml
index 24999a1187..448453778b 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/de.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/de.xml
@@ -1260,7 +1260,6 @@
Wählen Sie eine Version, um diese mit der aktuellen zu vergleichen
- Aktuelle VersionZeigt die Unterschiede zwischen der aktuellen und der ausgewählten Version an.<br />Text in <del>rot</del> fehlen in der ausgewählten Version, <ins>grün</ins> markierter Text wurde hinzugefügt.Dokument wurde zurückgesetztZeigt die ausgewählte Version als HTML an. Wenn Sie sich die Unterschiede zwischen zwei Versionen anzeigen lassen wollen, benutzen Sie bitte die Vergleichsansicht.
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
index af7b39849c..0bf175ca1a 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
@@ -1450,10 +1450,9 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Changes
- Created
- Current version
- Red text will be removed in the selected version, green text will be added]]>
+ Red text will be removed in the selected version, green text will be added]]>
+ There are no differences between the current (draft) version and the selected versionDocument has been rolled backSelect a version to compare with the current versionThis displays the selected version as HTML, if you wish to see the difference between 2
@@ -2786,6 +2785,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Allow in areasMake this block available by default within the areas of other Blocks (unless explicit permissions are set for these areas).When empty all Blocks allowed for Areas can be created.
+ When empty all Blocks allowed for Areas can be created.AreasGrid Columns for AreasDefine how many columns that will be available for areas. If not defined, the number of columns defined for the entire layout will be used.
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
index 4678acad16..23faf3747b 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
@@ -1490,11 +1490,10 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Changes
- CreatedSelect a version to compare with the current version
- Current version
- Red text will be removed in the selected version, green text will be added]]>
+ Red text will be removed in the selected version, green text will be added]]>
+ There are no differences between the current (draft) version and the selected versionDocument has been rolled backThis displays the selected version as HTML, if you wish to see the difference between 2
versions at the same time, use the diff view
@@ -1504,7 +1503,6 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
ViewVersions
- Current draft versionCurrent published version
@@ -2889,6 +2887,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Allow in areasMake this block available by default within the areas of other Blocks (unless explicit permissions are set for these areas).When empty all Blocks allowed for Areas can be created.
+ When empty all Blocks allowed for Areas can be created.AreasGrid Columns for AreasDefine how many columns that will be available for areas. If not defined, the number of columns defined for the entire layout will be used.
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml
index 1ed96d8807..4a111302b3 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml
@@ -898,7 +898,6 @@
Reiniciar
- Versión actualRed el texto de la versión seleccionada no se mostrará. , el verde significa añadido]]>Se ha recuperado la última versión del documento.Esto muestra la versión seleccionada como html, si deseas ver la diferencia entre 2 versiones al mismo tiempo, por favor usa la vista diff
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
index 24d5f565e5..384981e467 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
@@ -1251,7 +1251,6 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à
Sélectionnez une version à comparer avec la version actuelle
- Version actuelleLe texte en Rouge signifie qu'il a été supprimé de la version choisie, vert signifie ajouté]]>Le document a été restauré à une version antérieureCeci affiche la version choisie en tant que HTML, si vous souhaitez voir les différences entre les deux versions en même temps, utilisez la vue différentielle
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/he.xml b/src/Umbraco.Core/EmbeddedResources/Lang/he.xml
index c52961307d..819e71aec9 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/he.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/he.xml
@@ -589,7 +589,6 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
הסר קישור
- גירסה עדכניתטקסט אדום לא יוצג בגרסא שנבחרה, טקסט ירוק מייצט טקסט שנוסף.]]>המסמך שוחזר בהצלחהלהלן הגרסא שנבחרה כHTML, אם הינך לצפות בשינויים בין שתי הגרסאות בו זמנית, בחר ב diff
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/it.xml b/src/Umbraco.Core/EmbeddedResources/Lang/it.xml
index cea82fc4e0..c85274b80f 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/it.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/it.xml
@@ -1530,9 +1530,7 @@ Per gestire il tuo sito web, è sufficiente aprire il backoffice di Umbraco e in
Modifiche
- CreatoSeleziona una versione da confrontare con la versione corrente
-
Il testo in rosso non verrà mostrato nella versione selezionata, quello in verde verrà aggiunto]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml b/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml
index bcf9e8c9a9..28d512973f 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml
@@ -730,7 +730,6 @@ Runwayをインストールして作られた新しいウェブサイトがど
リセット
- 現在の版赤 の文字列は以前の版にはない部分で、緑の文字列は以前の版にのみある部分です。]]>ドキュメントは以前の版に戻りました選択した版をhtmlで表示します。2つの版の比較を表示したいときは、Diff を選択してください。
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml b/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml
index 6a20975bb1..dfe848387c 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml
@@ -575,7 +575,6 @@
링크 삭제
- 현재 버전빨간 텍스트는 선택한 버전에선 보이지 않습니다. 녹색은 추가되었음을 의미합니다]]>문서가 롤백되었습니다.선택한 버전을 html로 보여줍니다. 두 버전의 차이점을 동시에 보시려면, 차이점 보기를 사용하세요
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml b/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml
index 87bcb3138a..c19aa1df4f 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml
@@ -621,7 +621,6 @@ Vennlig hilsen Umbraco roboten
Nullstill
- Gjeldende versjonRød tekst vil ikke bli vist i den valgte versjonen. , grønn betyr lagt til]]>Dokumentet er tilbakeført til en tidligere versjonDette viser den valgte versjonen som HTML, bruk avviksvisningen hvis du ønsker å se forksjellene mellom to versjoner samtidig.
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml
index b2cbb5bda0..735302e951 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml
@@ -1253,9 +1253,7 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je
Wijzigingen
- AangemaaktSelecteer een versie om te vergelijken met de huidige versie
- Huidige versieRode tekst wordt niet getoond in de geselecteerde versie, groen betekent toegevoegd]]>Document is teruggezet
@@ -1267,7 +1265,6 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je
BekijkVersies
- ConceptversieGepubliceerde versie
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/pl.xml b/src/Umbraco.Core/EmbeddedResources/Lang/pl.xml
index 4801371fd8..a4d891fd8f 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/pl.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/pl.xml
@@ -881,7 +881,6 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb
Resetuj
- Aktualna wersjaCzerwony tekst nie będzie pokazany w wybranej wersji, zielony tekst został dodany]]>Dokument został przywróconyTu widać wybraną wersję jako html, jeżeli chcesz zobaczyć różnicę pomiędzy 2 wersjami w tym samym czasie, użyj podglądu różnic
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml b/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml
index 25060a4bd3..b5fd920365 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml
@@ -565,7 +565,6 @@ Você pode publicar esta página e todas suas sub-páginas ao selecionar pub
Remover Link
- Versão atualTexto vermelho não será mostrado na versão selecionada; verde significa adicionado]]>Documento foi revertidoIsto mostra a versão selecionada como html se você deseja ver as diferenças entre as 2 versões ao mesmo tempo use a visão em diff
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/ru.xml b/src/Umbraco.Core/EmbeddedResources/Lang/ru.xml
index d5b31e47d2..f83dd5285c 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/ru.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/ru.xml
@@ -1195,7 +1195,6 @@
'%0%' была переименована в '%1%'
- Текущая версияКрасным отмечен текст, которого уже нет в последней версии, зеленым - текст, который добавлен]]>Произведен откат к ранней версииТекущая версия показана в виде HTML. Для просмотра различий в версиях выберите режим сравнения
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
index fa359fbbbc..e2e7cbcd76 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
@@ -675,7 +675,6 @@
Återställ
- Nuvarande versionRöd text kommer inte att synas i den valda versionen. , Grön betyder att den har tillkommit]]>Dokumentet har återgått till en tidigare versionHär visas den valda sidversionen i HTML. Om du vill se skillnaden mellan två versioner samtidigt, välj istället "Diff".
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
index 47549f5f40..30a38ba6c7 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
@@ -1319,8 +1319,6 @@ Web sitenizi yönetmek için, Umbraco'nun arka ofisini açın ve içerik eklemey
Değişiklikler
- Oluşturuldu
- Mevcut sürüm Kırmızı metin seçili sürümde gösterilmeyecektir. , yeşil eklendi demektir ]]>Belge geri alındı Mevcut sürümle karşılaştırmak için bir sürüm seçin
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml b/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml
index 5d9a6e9ab3..199b185ed3 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml
@@ -763,7 +763,6 @@
Reset
- 当前版本红色是选中版本中没有的。绿色是新增的]]>文档已回滚
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml b/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml
index b3e3b7bdcf..d57c1c614d 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml
@@ -753,7 +753,6 @@
重設
- 當前版本紅色 文字將不會顯示於所選版本,而綠色表示增加部分。]]>文檔已回滾這顯示所選版本的HTML格式,如果您想要比較兩版本的差異,請使用比較檢視
diff --git a/src/Umbraco.Core/Models/PropertyTagsExtensions.cs b/src/Umbraco.Core/Models/PropertyTagsExtensions.cs
index d36baed604..b12cbe58ef 100644
--- a/src/Umbraco.Core/Models/PropertyTagsExtensions.cs
+++ b/src/Umbraco.Core/Models/PropertyTagsExtensions.cs
@@ -23,19 +23,15 @@ public static class PropertyTagsExtensions
IDataEditor? editor = propertyEditors[property.PropertyType?.PropertyEditorAlias];
TagsPropertyEditorAttribute? tagAttribute = editor?.GetTagAttribute();
- if (tagAttribute == null)
- {
- return null;
- }
var configurationObject = property.PropertyType is null
? null
: dataTypeService.GetDataType(property.PropertyType.DataTypeId)?.Configuration;
- TagConfiguration? configuration = ConfigurationEditor.ConfigurationAs(configurationObject);
+ TagConfiguration? configuration = configurationObject as TagConfiguration;
if (configuration is not null && configuration.Delimiter == default)
{
- configuration.Delimiter = tagAttribute.Delimiter;
+ configuration.Delimiter = tagAttribute?.Delimiter ?? ',';
}
return configuration;
diff --git a/src/Umbraco.Core/PropertyEditors/BlockListConfiguration.cs b/src/Umbraco.Core/PropertyEditors/BlockListConfiguration.cs
index 1dec9946d3..1184f2524f 100644
--- a/src/Umbraco.Core/PropertyEditors/BlockListConfiguration.cs
+++ b/src/Umbraco.Core/PropertyEditors/BlockListConfiguration.cs
@@ -16,6 +16,13 @@ public class BlockListConfiguration
[ConfigurationField("validationLimit", "Amount", "numberrange", Description = "Set a required range of blocks")]
public NumberRange ValidationLimit { get; set; } = new();
+ [ConfigurationField("useSingleBlockMode", "Single block mode", "boolean",
+ Description = @"When in Single block mode, the output will be BlockListItem<>, instead of BlockListModel.
+
+**NOTE:**
+Single block mode requires a maximum of one available block, and an amount set to minimum 1 and maximum 1 blocks.")]
+ public bool UseSingleBlockMode { get; set; }
+
[ConfigurationField("useLiveEditing", "Live editing mode", "boolean", Description = "Live editing in editor overlays for live updated custom views or labels using custom expression.")]
public bool UseLiveEditing { get; set; }
diff --git a/src/Umbraco.Core/PropertyEditors/IDataValueReference.cs b/src/Umbraco.Core/PropertyEditors/IDataValueReference.cs
index 39d7d7e130..6c863d66ff 100644
--- a/src/Umbraco.Core/PropertyEditors/IDataValueReference.cs
+++ b/src/Umbraco.Core/PropertyEditors/IDataValueReference.cs
@@ -14,4 +14,10 @@ public interface IDataValueReference
///
///
IEnumerable GetReferences(object? value);
+
+ ///
+ /// Returns all reference types that are automatically tracked.
+ ///
+ ///
+ IEnumerable GetAutomaticRelationTypesAliases() => Enumerable.Empty();
}
diff --git a/src/Umbraco.Core/PropertyEditors/IDataValueTags.cs b/src/Umbraco.Core/PropertyEditors/IDataValueTags.cs
new file mode 100644
index 0000000000..f809e787bc
--- /dev/null
+++ b/src/Umbraco.Core/PropertyEditors/IDataValueTags.cs
@@ -0,0 +1,18 @@
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.PropertyEditors;
+
+///
+/// Resolve tags from values
+///
+public interface IDataValueTags
+{
+ ///
+ /// Returns any tags contained in the value
+ ///
+ ///
+ ///
+ ///
+ ///
+ IEnumerable GetTags(object? value, object? dataTypeConfiguration, int? languageId);
+}
diff --git a/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs b/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs
index ff92c2012f..8206ab538b 100644
--- a/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs
+++ b/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs
@@ -5,6 +5,7 @@ namespace Umbraco.Extensions;
///
/// Provides extension methods for the interface to manage tags.
///
+[Obsolete]
public static class PropertyEditorTagsExtensions
{
///
diff --git a/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs b/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs
index 849d6446a9..d6f1584e8d 100644
--- a/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs
+++ b/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs
@@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
/// Marks property editors that support tags.
///
[AttributeUsage(AttributeTargets.Class)]
+[Obsolete("Implement a custom IDataValueEditor with the IDataValueTags interface instead")]
public class TagsPropertyEditorAttribute : Attribute
{
///
diff --git a/src/Umbraco.Infrastructure/Mapping/UmbracoMapper.cs b/src/Umbraco.Infrastructure/Mapping/UmbracoMapper.cs
index 09cfcf5aaf..8ebd803aac 100644
--- a/src/Umbraco.Infrastructure/Mapping/UmbracoMapper.cs
+++ b/src/Umbraco.Infrastructure/Mapping/UmbracoMapper.cs
@@ -1,7 +1,10 @@
using System.Collections;
using System.Collections.Concurrent;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Exceptions;
using Umbraco.Cms.Core.Scoping;
+using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Core.Mapping;
@@ -44,19 +47,32 @@ public class UmbracoMapper : IUmbracoMapper
private readonly ConcurrentDictionary>> _ctors =
new();
- private readonly ConcurrentDictionary>> _maps =
+ private readonly ConcurrentDictionary>> _maps =
new();
private readonly ICoreScopeProvider _scopeProvider;
+ private readonly ILogger _logger;
///
/// Initializes a new instance of the class.
///
///
///
- public UmbracoMapper(MapDefinitionCollection profiles, ICoreScopeProvider scopeProvider)
+ [Obsolete("Please use ctor that takes an ILogger")]
+ public UmbracoMapper(MapDefinitionCollection profiles, ICoreScopeProvider scopeProvider) : this(profiles, scopeProvider, StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The MapDefinitionCollection
+ /// The scope provider
+ /// The logger
+ public UmbracoMapper(MapDefinitionCollection profiles, ICoreScopeProvider scopeProvider, ILogger logger)
{
_scopeProvider = scopeProvider;
+ _logger = logger;
foreach (IMapDefinition profile in profiles)
{
@@ -119,15 +135,15 @@ public class UmbracoMapper : IUmbracoMapper
sourceCtors[targetType] = (source, context) => ctor((TSource)source, context)!;
}
- Dictionary> sourceMaps = DefineMaps(sourceType);
+ ConcurrentDictionary> sourceMaps = DefineMaps(sourceType);
sourceMaps[targetType] = (source, target, context) => map((TSource)source, (TTarget)target, context);
}
private Dictionary> DefineCtors(Type sourceType) =>
_ctors.GetOrAdd(sourceType, _ => new Dictionary>());
- private Dictionary> DefineMaps(Type sourceType) =>
- _maps.GetOrAdd(sourceType, _ => new Dictionary>());
+ private ConcurrentDictionary> DefineMaps(Type sourceType) =>
+ _maps.GetOrAdd(sourceType, _ => new ConcurrentDictionary>());
#endregion
@@ -428,7 +444,7 @@ public class UmbracoMapper : IUmbracoMapper
return null;
}
- if (_maps.TryGetValue(sourceType, out Dictionary>? sourceMap) &&
+ if (_maps.TryGetValue(sourceType, out ConcurrentDictionary>? sourceMap) &&
sourceMap.TryGetValue(targetType, out Action