Skip to content

Commit 22be517

Browse files
committed
publicizes the legacy parameter editor alias map, ensures that a YSOD is not shown when a legacy parameter editor is trying to be rendered, we just render a text box in its place
1 parent 8860e77 commit 22be517

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Umbraco.Core.PropertyEditors
1010
/// Used to map the legacy parameter editor aliases to the new ones, this is really just used during
1111
/// installation but has been put in a separate class in case we need it for other purposes
1212
/// </summary>
13-
internal static class LegacyParameterEditorAliasConverter
13+
public static class LegacyParameterEditorAliasConverter
1414
{
1515
/// <summary>
1616
/// The map consists of a key which is always the legacy alias + new alias (trimmed))

src/Umbraco.Web/Models/Mapping/MacroModelMapper.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using AutoMapper;
55
using Umbraco.Core;
6+
using Umbraco.Core.Logging;
67
using Umbraco.Core.Models;
78
using Umbraco.Core.Models.Mapping;
89
using Umbraco.Core.PropertyEditors;
@@ -34,12 +35,15 @@ public override void ConfigureMappings(IConfiguration config, ApplicationContext
3435
var paramEditor = ParameterEditorResolver.Current.GetByAlias(property.EditorAlias);
3536
if (paramEditor == null)
3637
{
37-
throw new InvalidOperationException("Could not resolve macro parameter editor: " + property.EditorAlias);
38+
//we'll just map this to a text box
39+
paramEditor = ParameterEditorResolver.Current.GetByAlias(Constants.PropertyEditors.TextboxAlias);
40+
LogHelper.Warn<MacroModelMapper>("Could not resolve a parameter editor with alias " + property.EditorAlias + ", a textbox will be rendered in it's place");
3841
}
39-
parameter.View = paramEditor.ValueEditor.View;
4042

43+
parameter.View = paramEditor.ValueEditor.View;
4144
//set the config
4245
parameter.Configuration = paramEditor.Configuration;
46+
4347
});
4448

4549
}

0 commit comments

Comments
 (0)