Lots of work on U4-2722 Change Property Editors over to use unique alias instead of GUID

it compiles but i haven't had time to test anything yet, will start all unit testing/fixing tomorrow, just needed to save this work somewhere.
This commit is contained in:
Shannon
2013-09-05 18:38:54 +10:00
parent e4cb079ae1
commit 45dabd6293
41 changed files with 716 additions and 331 deletions

View File

@@ -1088,14 +1088,14 @@ namespace Umbraco.Core.Services
//Special case for the Upload DataType
//TODO: Should we handle this with events?
var uploadDataTypeId = new Guid(Constants.PropertyEditors.UploadField);
if (content.Properties.Any(x => x.PropertyType.DataTypeId == uploadDataTypeId))
if (content.Properties.Any(x => x.PropertyType.PropertyEditorAlias == Constants.PropertyEditors.UploadFieldAlias))
{
bool isUpdated = false;
var fs = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>();
//Loop through properties to check if the content contains media that should be deleted
foreach (var property in content.Properties.Where(x => x.PropertyType.DataTypeId == uploadDataTypeId
foreach (var property in content.Properties.Where(x => x.PropertyType.PropertyEditorAlias == Constants.PropertyEditors.UploadFieldAlias
&& string.IsNullOrEmpty(x.Value.ToString()) == false))
{
if (fs.FileExists(IOHelper.MapPath(property.Value.ToString())))
@@ -1125,8 +1125,7 @@ namespace Umbraco.Core.Services
}
//Special case for the Tags DataType
var tagsDataTypeId = new Guid(Constants.PropertyEditors.Tags);
if (content.Properties.Any(x => x.PropertyType.DataTypeId == tagsDataTypeId))
if (content.Properties.Any(x => x.PropertyType.PropertyEditorAlias == Constants.PropertyEditors.TagsAlias))
{
var tags = uow.Database.Fetch<TagRelationshipDto>("WHERE nodeId = @Id", new { Id = content.Id });
foreach (var tag in tags)