Merge branch 'temp8' into temp8-fix-default-userid-param

This commit is contained in:
Warren Buckley
2019-02-06 14:56:52 +00:00
7 changed files with 62 additions and 7 deletions

View File

@@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NPoco;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.Dtos;
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
@@ -59,5 +61,58 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
Database.Update(dto);
}
}
// we *need* to use this private DTO here, which does *not* have extra properties, which would kill the migration
[TableName(TableName)]
[PrimaryKey("pk")]
[ExplicitColumns]
private class ContentTypeDto
{
public const string TableName = Constants.DatabaseSchema.Tables.ContentType;
[Column("pk")]
[PrimaryKeyColumn(IdentitySeed = 535)]
public int PrimaryKey { get; set; }
[Column("nodeId")]
[ForeignKey(typeof(NodeDto))]
[Index(IndexTypes.UniqueNonClustered, Name = "IX_cmsContentType")]
public int NodeId { get; set; }
[Column("alias")]
[NullSetting(NullSetting = NullSettings.Null)]
public string Alias { get; set; }
[Column("icon")]
[Index(IndexTypes.NonClustered)]
[NullSetting(NullSetting = NullSettings.Null)]
public string Icon { get; set; }
[Column("thumbnail")]
[Constraint(Default = "folder.png")]
public string Thumbnail { get; set; }
[Column("description")]
[NullSetting(NullSetting = NullSettings.Null)]
[Length(1500)]
public string Description { get; set; }
[Column("isContainer")]
[Constraint(Default = "0")]
public bool IsContainer { get; set; }
[Column("allowAtRoot")]
[Constraint(Default = "0")]
public bool AllowAtRoot { get; set; }
[Column("variations")]
[Constraint(Default = "1" /*ContentVariation.InvariantNeutral*/)]
public byte Variations { get; set; }
[ResultColumn]
public NodeDto NodeDto { get; set; }
}
}
}

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override IRepositoryCachePolicy<IServerRegistration, int> CreateCachePolicy()
{
// TODO: wtf are we doing with cache here?
// TODO: what are we doing with cache here?
// why are we using disabled cache helper up there?
//
// 7.6 says:

View File

@@ -61,7 +61,7 @@ namespace Umbraco.Core.Services.Implement
var filename = Path.GetFileNameWithoutExtension(localCopy.FullName).Replace("_", "-");
// TODO: Fix this nonsense... would have to wait until v8 to store the language files with their correct
// names instead of storing them as 2 letters but actually having a 4 letter culture. wtf. So now, we
// names instead of storing them as 2 letters but actually having a 4 letter culture. So now, we
// need to check if the file is 2 letters, then open it to try to find it's 4 letter culture, then use that
// if it's successful. We're going to assume (though it seems assuming in the legacy logic is never a great idea)
// that any 4 letter file is named with the actual culture that it is!

View File

@@ -587,7 +587,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
{
int id;
if (int.TryParse(itemm.GetAttribute("id", ""), out id) == false)
continue; // wtf?
continue; // uh?
var captured = itemm;
var cacheValues = GetCacheValues(id, idd => ConvertFromXPathNavigator(captured));
mediaList.Add(CreateFromCacheValues(cacheValues));

View File

@@ -311,7 +311,7 @@ namespace Umbraco.Tests.Persistence.Repositories
Assert.AreEqual(4, contentType.PropertyTypes.Count());
// remove all templates - since they are not saved, they would break the (wtf) mapping code
// remove all templates - since they are not saved, they would break the (!) mapping code
contentType.AllowedTemplates = new ITemplate[0];
// there is NO mapping from display to contentType, but only from save

View File

@@ -157,7 +157,7 @@ namespace Umbraco.Tests.Testing
// etc
ComposeWeb();
ComposeWtf();
ComposeMisc();
// not sure really
Compose(Composition);
@@ -233,7 +233,7 @@ namespace Umbraco.Tests.Testing
}
protected virtual void ComposeWtf()
protected virtual void ComposeMisc()
{
// what else?
var runtimeStateMock = new Mock<IRuntimeState>();

View File

@@ -25,7 +25,7 @@ namespace Umbraco.Web.Models.Mapping
where TPropertyTypeBasic : PropertyTypeBasic
{
return mapping
.ConstructUsing(x => new PropertyGroup(false)) // TODO: we have NO idea of isPublishing here = wtf?
.ConstructUsing(x => new PropertyGroup(false)) // TODO: we have NO idea of isPublishing here = so what?
.IgnoreEntityCommonProperties()
.ForMember(dest => dest.Id, map => map.Condition(src => src.Id > 0))
.ForMember(dest => dest.Key, map => map.Ignore())