Skip to content

Commit c3523a0

Browse files
committed
WIP WIP WIP. Started working on U4-5648 which led to quite a lot of other things, once IDataType was removed (U4-5858), this lead to U4-5546, U4-5416, U4-5484, U4-5805. So much of this stuff is etched deep into the codebase, so nice to get rid of it. Had to remove the codefirst tests too for now since they relied on old apis and we don't really support it/use it. Commented out all of the code relating to the document type editor UI bits since they need to be rewritten and removed.
1 parent 854bf5a commit c3523a0

File tree

248 files changed

+4161
-21365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+4161
-21365
lines changed

src/Umbraco.Core/CoreBootManager.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,7 @@ protected virtual void InitializeResolvers()
296296

297297
CacheRefreshersResolver.Current = new CacheRefreshersResolver(
298298
() => PluginManager.Current.ResolveCacheRefreshers());
299-
300-
DataTypesResolver.Current = new DataTypesResolver(
301-
() => PluginManager.Current.ResolveDataTypes());
302-
299+
303300
MacroFieldEditorsResolver.Current = new MacroFieldEditorsResolver(
304301
() => PluginManager.Current.ResolveMacroRenderings());
305302

@@ -313,9 +310,6 @@ protected virtual void InitializeResolvers()
313310
MigrationResolver.Current = new MigrationResolver(
314311
() => PluginManager.Current.ResolveTypes<IMigration>());
315312

316-
// todo: remove once we drop IPropertyEditorValueConverter support.
317-
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
318-
PluginManager.Current.ResolvePropertyEditorValueConverters());
319313

320314
// need to filter out the ones we dont want!!
321315
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(

src/Umbraco.Core/DataTypesResolver.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Umbraco.Core/Models/DataTypeDefinition.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,6 @@ public class DataTypeDefinition : Entity, IDataTypeDefinition
3232
private string _propertyEditorAlias;
3333
private DataTypeDatabaseType _databaseType;
3434

35-
[Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the alternative contructor that specifies an alias")]
36-
public DataTypeDefinition(int parentId, Guid controlId)
37-
{
38-
_parentId = parentId;
39-
40-
_propertyEditorAlias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(controlId, false);
41-
if (_propertyEditorAlias == null)
42-
{
43-
//convert to Label!
44-
LogHelper.Warn<DataTypeDefinition>("Could not find a GUID -> Alias mapping for the legacy property editor with id " + controlId + ". The DataType has been converted to a Label.");
45-
_propertyEditorAlias = Constants.PropertyEditors.NoEditAlias;
46-
}
47-
48-
_additionalData = new Dictionary<string, object>();
49-
}
5035
public DataTypeDefinition(int parentId, string propertyEditorAlias)
5136
{
5237
_parentId = parentId;
@@ -205,27 +190,6 @@ public string PropertyEditorAlias
205190
}
206191
}
207192

208-
/// <summary>
209-
/// Id of the DataType control
210-
/// </summary>
211-
[DataMember]
212-
[Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the PropertyEditorAlias property instead. This method will return a generated GUID for any property editor alias not explicitly mapped to a legacy ID")]
213-
public Guid ControlId
214-
{
215-
get
216-
{
217-
return LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(
218-
_propertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.GenerateId).Value;
219-
}
220-
set
221-
{
222-
var alias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(value, true);
223-
PropertyEditorAlias = alias;
224-
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
225-
_additionalData["ControlId"] = value;
226-
}
227-
}
228-
229193
/// <summary>
230194
/// Gets or Sets the DatabaseType for which the DataType's value is saved as
231195
/// </summary>

src/Umbraco.Core/Models/IDataTypeDefinition.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ public interface IDataTypeDefinition : IUmbracoEntity
1010
/// </summary>
1111
string PropertyEditorAlias { get; set; }
1212

13-
/// <summary>
14-
/// Id of the DataType control
15-
/// </summary>
16-
[Obsolete("Property editor's are defined by a string alias from version 7 onwards, use the PropertyEditorAlias property instead")]
17-
Guid ControlId { get; set; }
18-
1913
/// <summary>
2014
/// Gets or Sets the DatabaseType for which the DataType's value is saved as
2115
/// </summary>

src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ private void InitializeConverters()
170170
_converter = null;
171171

172172
//get all converters for this property type
173-
// todo: remove Union() once we drop IPropertyEditorValueConverter support.
174-
var foundConverters = converters.Union(GetCompatConverters()).Where(x => x.IsConverter(this)).ToArray();
173+
var foundConverters = converters.Where(x => x.IsConverter(this)).ToArray();
175174
if (foundConverters.Length == 1)
176175
{
177176
_converter = foundConverters[0];
@@ -357,43 +356,7 @@ internal static object ConvertUsingDarkMagic(object source)
357356

358357
#endregion
359358

360-
#region Compat
361-
362-
// backward-compatibility: support IPropertyEditorValueConverter while we have to
363-
// todo: remove once we drop IPropertyEditorValueConverter support.
364-
365-
IEnumerable<IPropertyValueConverter> GetCompatConverters()
366-
{
367-
var propertyEditorGuid = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(PropertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.ReturnNull);
368-
return PropertyEditorValueConvertersResolver.HasCurrent && propertyEditorGuid.HasValue
369-
? PropertyEditorValueConvertersResolver.Current.Converters
370-
.Where(x => x.IsConverterFor(propertyEditorGuid.Value, ContentType.Alias, PropertyTypeAlias))
371-
.Select(x => new CompatConverter(x))
372-
: Enumerable.Empty<IPropertyValueConverter>();
373-
}
374-
375-
private class CompatConverter : PropertyValueConverterBase
376-
{
377-
private readonly IPropertyEditorValueConverter _converter;
378-
379-
public CompatConverter(IPropertyEditorValueConverter converter)
380-
{
381-
_converter = converter;
382-
}
383-
384-
public override bool IsConverter(PublishedPropertyType propertyType)
385-
{
386-
return true;
387-
}
388-
389-
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
390-
{
391-
// NOTE: ignore preview, because IPropertyEditorValueConverter does not support it
392-
return _converter.ConvertPropertyValue(source).Result;
393-
}
394-
}
395-
396-
#endregion
359+
397360

398361
#region Detached
399362

src/Umbraco.Core/Packaging/Models/PreInstallWarnings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ internal class PreInstallWarnings
1414
public IEnumerable<IMacro> ConflictingMacroAliases { get; set; }
1515
public IEnumerable<ITemplate> ConflictingTemplateAliases { get; set; }
1616
public IEnumerable<IFile> ConflictingStylesheetNames { get; set; }
17-
public IEnumerable<string> AssembliesWithLegacyPropertyEditors { get; set; }
1817
}
1918
}

src/Umbraco.Core/Packaging/PackageInstallation.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ private PreInstallWarnings GetPreInstallWarnings(string packagePath, XElement ro
447447

448448
installWarnings.UnsecureFiles = FindUnsecureFiles(sourceDestination);
449449
installWarnings.FilesReplaced = FindFilesToBeReplaced(sourceDestination);
450-
installWarnings.AssembliesWithLegacyPropertyEditors = FindLegacyPropertyEditors(packagePath, sourceDestination);
451450

452451
return installWarnings;
453452
}
@@ -456,20 +455,7 @@ private KeyValuePair<string, string>[] FindFilesToBeReplaced(IEnumerable<KeyValu
456455
{
457456
return sourceDestination.Where(sd => File.Exists(Path.Combine(FullPathToRoot, sd.Value))).ToArray();
458457
}
459-
460-
private IEnumerable<string> FindLegacyPropertyEditors(string packagePath, IEnumerable<KeyValuePair<string, string>> sourceDestinationPair)
461-
{
462-
var dlls = sourceDestinationPair.Where(
463-
sd => (Path.GetExtension(sd.Value) ?? string.Empty).Equals(".dll", StringComparison.InvariantCultureIgnoreCase)).Select(sd => sd.Key).ToArray();
464-
465-
if (dlls.Any() == false) { return new List<string>(); }
466-
467-
// Now we want to see if the DLLs contain any legacy data types since we want to warn people about that
468-
string[] assemblyErrors;
469-
IEnumerable<byte[]> assemblyesToScan =_packageExtraction.ReadFilesFromArchive(packagePath, dlls);
470-
return PackageBinaryInspector.ScanAssembliesForTypeReference<IDataType>(assemblyesToScan, out assemblyErrors).ToArray();
471-
}
472-
458+
473459
private KeyValuePair<string, string>[] FindUnsecureFiles(IEnumerable<KeyValuePair<string, string>> sourceDestinationPair)
474460
{
475461
return sourceDestinationPair.Where(sd => IsFileDestinationUnsecure(sd.Value)).ToArray();

src/Umbraco.Core/PluginManager.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -510,24 +510,8 @@ internal IEnumerable<Type> ResolveCacheRefreshers()
510510
return ResolveTypes<ICacheRefresher>();
511511
}
512512

513-
/// <summary>
514-
/// Returns all available IPropertyEditorValueConverter
515-
/// </summary>
516-
/// <returns></returns>
517-
internal IEnumerable<Type> ResolvePropertyEditorValueConverters()
518-
{
519-
return ResolveTypes<IPropertyEditorValueConverter>();
520-
}
521-
522-
/// <summary>
523-
/// Returns all available IDataType in application
524-
/// </summary>
525-
/// <returns></returns>
526-
internal IEnumerable<Type> ResolveDataTypes()
527-
{
528-
return ResolveTypes<IDataType>();
529-
}
530-
513+
514+
531515
/// <summary>
532516
/// Returns all available IMacroGuiRendering in application
533517
/// </summary>

src/Umbraco.Core/PropertyEditors/BackwardsCompatibleData.cs

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)