Fixes: U4-4182 Exception during plugins loading
This commit is contained in:
@@ -318,11 +318,9 @@ namespace Umbraco.Core
|
||||
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
|
||||
PluginManager.Current.ResolvePropertyEditorValueConverters());
|
||||
|
||||
//add the internal ones, these are not public currently so need to add them manually
|
||||
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(
|
||||
PluginManager.Current.ResolvePropertyValueConverters());
|
||||
// fixme - why not use the following syntax?
|
||||
//PluginManager.Current.ResolveTypes<IPropertyValueConverter>());
|
||||
// need to filter out the ones we dont want!!
|
||||
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(
|
||||
PluginManager.Current.ResolveTypes<IPropertyValueConverter>());
|
||||
|
||||
// use the new DefaultShortStringHelper
|
||||
ShortStringHelperResolver.Current = new ShortStringHelperResolver(
|
||||
|
||||
13
src/Umbraco.Core/HideFromTypeFinderAttribute.cs
Normal file
13
src/Umbraco.Core/HideFromTypeFinderAttribute.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to notify the TypeFinder to ignore any class attributed with this during it's discovery
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public sealed class HideFromTypeFinderAttribute : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -269,7 +269,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
: Enumerable.Empty<IPropertyValueConverter>();
|
||||
}
|
||||
|
||||
class CompatConverter : PropertyValueConverterBase
|
||||
private class CompatConverter : PropertyValueConverterBase
|
||||
{
|
||||
private readonly IPropertyEditorValueConverter _converter;
|
||||
|
||||
|
||||
@@ -507,15 +507,6 @@ namespace Umbraco.Core
|
||||
return ResolveTypes<IPropertyEditorValueConverter>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all available PropertyValueConverter
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal IEnumerable<Type> ResolvePropertyValueConverters()
|
||||
{
|
||||
return ResolveTypes<IPropertyValueConverter>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all available IDataType in application
|
||||
/// </summary>
|
||||
|
||||
@@ -525,8 +525,12 @@ namespace Umbraco.Core
|
||||
|
||||
//now filter the types based on the onlyConcreteClasses flag, not interfaces, not static classes
|
||||
var filteredTypes = allSubTypes
|
||||
.Where(t => (TypeHelper.IsNonStaticClass(t)
|
||||
.Where(t => (TypeHelper.IsNonStaticClass(t)
|
||||
//Do not include nested private classes - since we are in full trust now this will find those too!
|
||||
&& t.IsNestedPrivate == false
|
||||
&& (onlyConcreteClasses == false || t.IsAbstract == false)
|
||||
//Do not include classes that are flagged to hide from the type finder
|
||||
&& t.GetCustomAttribute<HideFromTypeFinderAttribute>() == null
|
||||
&& additionalFilter(t)))
|
||||
.ToArray();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Reflection;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// A utility class for type checking, this provides internal caching so that calls to these methods will be faster
|
||||
/// than doing a manual type check in c#
|
||||
/// </summary>
|
||||
|
||||
@@ -304,6 +304,7 @@
|
||||
<Compile Include="Events\RollbackEventArgs.cs" />
|
||||
<Compile Include="Events\SaveEventArgs.cs" />
|
||||
<Compile Include="Events\SendToPublishEventArgs.cs" />
|
||||
<Compile Include="HideFromTypeFinderAttribute.cs" />
|
||||
<Compile Include="IApplicationEventHandler.cs" />
|
||||
<Compile Include="IDisposeOnRequestEnd.cs" />
|
||||
<Compile Include="IO\ResizedImage.cs" />
|
||||
|
||||
Reference in New Issue
Block a user