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
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Umbraco.Core.PropertyEditors
|
||||
/// Used to map the legacy parameter editor aliases to the new ones, this is really just used during
|
||||
/// installation but has been put in a separate class in case we need it for other purposes
|
||||
/// </summary>
|
||||
internal static class LegacyParameterEditorAliasConverter
|
||||
public static class LegacyParameterEditorAliasConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// The map consists of a key which is always the legacy alias + new alias (trimmed))
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
@@ -34,12 +35,15 @@ namespace Umbraco.Web.Models.Mapping
|
||||
var paramEditor = ParameterEditorResolver.Current.GetByAlias(property.EditorAlias);
|
||||
if (paramEditor == null)
|
||||
{
|
||||
throw new InvalidOperationException("Could not resolve macro parameter editor: " + property.EditorAlias);
|
||||
//we'll just map this to a text box
|
||||
paramEditor = ParameterEditorResolver.Current.GetByAlias(Constants.PropertyEditors.TextboxAlias);
|
||||
LogHelper.Warn<MacroModelMapper>("Could not resolve a parameter editor with alias " + property.EditorAlias + ", a textbox will be rendered in it's place");
|
||||
}
|
||||
parameter.View = paramEditor.ValueEditor.View;
|
||||
|
||||
parameter.View = paramEditor.ValueEditor.View;
|
||||
//set the config
|
||||
parameter.Configuration = paramEditor.Configuration;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user