fix up merge errors

This commit is contained in:
Shannon
2013-08-07 10:34:51 +10:00
parent 0a26eccd2d
commit 65d7e04049
2 changed files with 17 additions and 17 deletions

View File

@@ -3,6 +3,8 @@ using System.Xml;
using System.Xml.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using umbraco.interfaces;
namespace Umbraco.Core.Models
{
@@ -39,19 +41,6 @@ namespace Umbraco.Core.Models
// XML construct from the value returned from the Property Editor.
// More details discussed here: https://groups.google.com/forum/?fromgroups=#!topic/umbraco-dev/fieWZzHj7oY
//var dataType = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(property.PropertyType.DataTypeDefinitionId);
//if (dataType == null) throw new InvalidOperationException("No data type definition found with id " + property.PropertyType.DataTypeDefinitionId);
//We've already got the value for the property so we're going to give it to the
// data type's data property so it doesn't go re-look up the value from the db again.
var defaultData = dt.Data as IDataValueSetter;
if (defaultData != null)
{
defaultData.SetValue(property.Value, property.PropertyType.DataTypeDatabaseType.ToString());
}
xmlNode.AppendChild(dt.Data.ToXMl(xd));
var propertyEditor = PropertyEditorResolver.Current.GetById(property.PropertyType.DataTypeId);
if (propertyEditor != null)
{
@@ -86,7 +75,15 @@ namespace Umbraco.Core.Models
else
{
//NOTE: An exception will be thrown if this doesn't exist
var legacyDataType = property.PropertyType.DataType(property.Id);
var legacyDataType = property.PropertyType.DataType(property.Id, ApplicationContext.Current.Services.DataTypeService);
//We've already got the value for the property so we're going to give it to the
// data type's data property so it doesn't go re-look up the value from the db again.
var defaultData = legacyDataType.Data as IDataValueSetter;
if (defaultData != null)
{
defaultData.SetValue(property.Value, property.PropertyType.DataTypeDatabaseType.ToString());
}
xmlNode.AppendChild(legacyDataType.Data.ToXMl(xd));
}

View File

@@ -57,17 +57,20 @@ namespace Umbraco.Tests.TestHelpers
var path = TestHelper.CurrentAssemblyDirectory;
AppDomain.CurrentDomain.SetData("DataDirectory", path);
//disable cache
var cacheHelper = new CacheHelper(new NullCacheProvider(), false);
var dbFactory = new DefaultDatabaseFactory(
GetDbConnectionString(),
GetDbProviderName());
_appContext = new ApplicationContext(
//assign the db context
new DatabaseContext(dbFactory),
//assign the service context
new ServiceContext(new PetaPocoUnitOfWorkProvider(dbFactory), new FileUnitOfWorkProvider(), new PublishingStrategy()),
//disable cache
false)
new ServiceContext(new PetaPocoUnitOfWorkProvider(dbFactory), new FileUnitOfWorkProvider(), new PublishingStrategy(), cacheHelper),
cacheHelper)
{
IsReady = true
};