Merge branch '7.4.0' of https://github.com/umbraco/Umbraco-CMS into 7.4.0
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
7.4.0
|
||||
7.4.0
|
||||
beta
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration
|
||||
/// Gets the version comment (like beta or RC).
|
||||
/// </summary>
|
||||
/// <value>The version comment.</value>
|
||||
public static string CurrentComment { get { return ""; } }
|
||||
public static string CurrentComment { get { return "beta"; } }
|
||||
|
||||
// Get the version of the umbraco.dll by looking at a class in that dll
|
||||
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseAnnotations;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
|
||||
namespace Umbraco.Core.Models.Rdbms
|
||||
{
|
||||
[TableName("umbracoDeployChecksum")]
|
||||
[PrimaryKey("id")]
|
||||
[ExplicitColumns]
|
||||
internal class UmbracoDeployChecksumDto
|
||||
{
|
||||
[Column("id")]
|
||||
[PrimaryKeyColumn(Name = "PK_umbracoDeployChecksum")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("entityType")]
|
||||
[Length(32)]
|
||||
[NullSetting(NullSetting = NullSettings.NotNull)]
|
||||
[Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoDeployChecksum", ForColumns = "entityType,entityGuid,entityPath")]
|
||||
public string EntityType { get; set; }
|
||||
|
||||
[Column("entityGuid")]
|
||||
[NullSetting(NullSetting = NullSettings.Null)]
|
||||
public Guid EntityGuid { get; set; }
|
||||
|
||||
[Column("entityPath")]
|
||||
[Length(256)]
|
||||
[NullSetting(NullSetting = NullSettings.Null)]
|
||||
public string EntityPath { get; set; }
|
||||
|
||||
[Column("localChecksum")]
|
||||
[NullSetting(NullSetting = NullSettings.NotNull)]
|
||||
[Length(32)]
|
||||
public string LocalChecksum { get; set; }
|
||||
|
||||
[Column("compositeChecksum")]
|
||||
[NullSetting(NullSetting = NullSettings.Null)]
|
||||
[Length(32)]
|
||||
public string CompositeChecksum { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseAnnotations;
|
||||
|
||||
namespace Umbraco.Core.Models.Rdbms
|
||||
{
|
||||
[TableName("umbracoDeployDependency")]
|
||||
[ExplicitColumns]
|
||||
internal class UmbracoDeployDependencyDto
|
||||
{
|
||||
[Column("sourceId")]
|
||||
[PrimaryKeyColumn(AutoIncrement = false, Clustered = true, Name = "PK_umbracoDeployDependency", OnColumns = "sourceId, targetId")]
|
||||
[ForeignKey(typeof(UmbracoDeployChecksumDto), Name = "FK_umbracoDeployDependency_umbracoDeployChecksum_id1")]
|
||||
[NullSetting(NullSetting = NullSettings.NotNull)]
|
||||
public int SourceId { get; set; }
|
||||
|
||||
[Column("targetId")]
|
||||
[ForeignKey(typeof(UmbracoDeployChecksumDto), Name = "FK_umbracoDeployDependency_umbracoDeployChecksum_id2")]
|
||||
[NullSetting(NullSetting = NullSettings.NotNull)]
|
||||
public int TargetId { get; set; }
|
||||
|
||||
[Column("mode")]
|
||||
[NullSetting(NullSetting = NullSettings.NotNull)]
|
||||
public int Mode { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
|
||||
private void CreateCmsPropertyTypeData()
|
||||
{
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = -90, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = 1043, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
|
||||
|
||||
@@ -82,7 +82,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
{42, typeof (AccessRuleDto)},
|
||||
{43, typeof(CacheInstructionDto)},
|
||||
{44, typeof (ExternalLoginDto)},
|
||||
{45, typeof (MigrationDto)}
|
||||
{45, typeof (MigrationDto)},
|
||||
{46, typeof (UmbracoDeployChecksumDto)},
|
||||
{47, typeof (UmbracoDeployDependencyDto)}
|
||||
};
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -119,6 +119,12 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
return new Version(7, 2, 5);
|
||||
}
|
||||
|
||||
//if the error is for umbracoDeployChecksum it must be the previous version to 7.4 since that is when it is added
|
||||
if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.InvariantEquals("umbracoDeployChecksum"))))
|
||||
{
|
||||
return new Version(7, 3, 4);
|
||||
}
|
||||
|
||||
return UmbracoVersion.Current;
|
||||
}
|
||||
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 5, GlobalSettings.UmbracoMigrationName)]
|
||||
public class AddUmbracoDeployTables : MigrationBase
|
||||
{
|
||||
public AddUmbracoDeployTables(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
: base(sqlSyntax, logger)
|
||||
{ }
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
//Don't exeucte if the table is already there
|
||||
var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray();
|
||||
if (tables.InvariantContains("umbracoDeployChecksum")) return;
|
||||
|
||||
Create.Table("umbracoDeployChecksum")
|
||||
.WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoDeployChecksum")
|
||||
.WithColumn("entityType").AsString(32).NotNullable()
|
||||
.WithColumn("entityGuid").AsGuid().Nullable()
|
||||
.WithColumn("entityPath").AsString(256).Nullable()
|
||||
.WithColumn("localChecksum").AsString(32).NotNullable()
|
||||
.WithColumn("compositeChecksum").AsString(32).Nullable();
|
||||
|
||||
Create.Table("umbracoDeployDependency")
|
||||
.WithColumn("sourceId").AsInt32().NotNullable().ForeignKey("FK_umbracoDeployDependency_umbracoDeployChecksum_id1", "umbracoDeployChecksum", "id")
|
||||
.WithColumn("targetId").AsInt32().NotNullable().ForeignKey("FK_umbracoDeployDependency_umbracoDeployChecksum_id2", "umbracoDeployChecksum", "id")
|
||||
.WithColumn("mode").AsInt32().NotNullable();
|
||||
|
||||
Create.PrimaryKey("PK_umbracoDeployDependency").OnTable("umbracoDeployDependency").Columns(new[] {"sourceId", "targetId"});
|
||||
|
||||
Create.Index("IX_umbracoDeployChecksum").OnTable("umbracoDeployChecksum")
|
||||
.OnColumn("entityType")
|
||||
.Ascending()
|
||||
.OnColumn("entityGuid")
|
||||
.Ascending()
|
||||
.OnColumn("entityPath")
|
||||
.Unique();
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer
|
||||
/// alias, so we need to ensure that these are initially consistent on
|
||||
/// all environments (based on the alias).
|
||||
/// </summary>
|
||||
[Migration("7.4.0", 2, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)]
|
||||
public class EnsureContentTypeUniqueIdsAreConsistent : MigrationBase
|
||||
{
|
||||
public EnsureContentTypeUniqueIdsAreConsistent(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 4, GlobalSettings.UmbracoMigrationName)]
|
||||
public class RemoveParentIdPropertyTypeGroupColumn : MigrationBase
|
||||
{
|
||||
public RemoveParentIdPropertyTypeGroupColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
@@ -394,6 +394,8 @@
|
||||
<Compile Include="Models\Rdbms\DocumentPublishedReadOnlyDto.cs" />
|
||||
<Compile Include="Models\Rdbms\ExternalLoginDto.cs" />
|
||||
<Compile Include="Models\Rdbms\MigrationDto.cs" />
|
||||
<Compile Include="Models\Rdbms\UmbracoDeployChecksumDto.cs" />
|
||||
<Compile Include="Models\Rdbms\UmbracoDeployDependencyDto.cs" />
|
||||
<Compile Include="Models\UmbracoDomain.cs" />
|
||||
<Compile Include="Models\DoNotCloneAttribute.cs" />
|
||||
<Compile Include="Models\IDomain.cs" />
|
||||
@@ -410,6 +412,7 @@
|
||||
<Compile Include="Persistence\Mappers\MigrationEntryMapper.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\FixListViewMediaSortOrder.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\AddDataDecimalColumn.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\AddUmbracoDeployTables.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\AddUniqueIdPropertyTypeGroupColumn.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourZero\RemoveParentIdPropertyTypeGroupColumn.cs" />
|
||||
<Compile Include="Persistence\Mappers\TaskTypeMapper.cs" />
|
||||
|
||||
@@ -580,6 +580,31 @@ namespace Umbraco.Tests.Persistence
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Create_umbracoDeployDependency_Table()
|
||||
{
|
||||
|
||||
using (Transaction transaction = Database.GetTransaction())
|
||||
{
|
||||
DatabaseSchemaHelper.CreateTable<UmbracoDeployChecksumDto>();
|
||||
DatabaseSchemaHelper.CreateTable<UmbracoDeployDependencyDto>();
|
||||
|
||||
//transaction.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Create_umbracoDeployChecksum_Table()
|
||||
{
|
||||
|
||||
using (Transaction transaction = Database.GetTransaction())
|
||||
{
|
||||
DatabaseSchemaHelper.CreateTable<UmbracoDeployChecksumDto>();
|
||||
|
||||
//transaction.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Create_umbracoUser_Table()
|
||||
{
|
||||
|
||||
@@ -110,7 +110,6 @@
|
||||
];
|
||||
|
||||
if ($routeParams.create) {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
//we are creating so get an empty data type item
|
||||
@@ -124,7 +123,6 @@
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
contentTypeResource.getById($routeParams.id).then(function (dt) {
|
||||
@@ -141,7 +139,6 @@
|
||||
/* ---------- SAVE ---------- */
|
||||
|
||||
function save() {
|
||||
|
||||
var deferred = $q.defer();
|
||||
|
||||
vm.page.saveButtonState = "busy";
|
||||
@@ -206,18 +203,15 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
vm.page.saveButtonState = "error";
|
||||
|
||||
deferred.reject(err);
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
|
||||
}
|
||||
|
||||
function init(contentType) {
|
||||
|
||||
//get available composite types
|
||||
contentTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) {
|
||||
contentType.availableCompositeContentTypes = result;
|
||||
@@ -237,8 +231,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// sort properties after sort order
|
||||
angular.forEach(contentType.groups, function (group) {
|
||||
group.properties = $filter('orderBy')(group.properties, 'sortOrder');
|
||||
@@ -250,17 +242,16 @@
|
||||
contentType.allowedTemplates = contentTypeHelper.insertTemplatePlaceholder(contentType.allowedTemplates);
|
||||
}
|
||||
|
||||
|
||||
// convert icons for content type
|
||||
convertLegacyIcons(contentType);
|
||||
|
||||
//set a shared state
|
||||
editorState.set(contentType);
|
||||
|
||||
vm.contentType = contentType;
|
||||
|
||||
}
|
||||
|
||||
function convertLegacyIcons(contentType) {
|
||||
|
||||
// make array to store contentType icon
|
||||
var contentTypeArray = [];
|
||||
|
||||
@@ -272,11 +263,9 @@
|
||||
|
||||
// set icon back on contentType
|
||||
contentType.icon = contentTypeArray[0].icon;
|
||||
|
||||
}
|
||||
|
||||
function getDataTypeDetails(property) {
|
||||
|
||||
if (property.propertyState !== "init") {
|
||||
|
||||
dataTypeResource.getById(property.dataTypeId)
|
||||
@@ -287,18 +276,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Syncs the content type to it's tree node - this occurs on first load and after saving */
|
||||
function syncTreeNode(dt, path, initialLoad) {
|
||||
|
||||
navigationService.syncTree({ tree: "documenttypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
|
||||
vm.currentNode = syncArgs.node;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.DocumentTypes.EditController", DocumentTypesEditController);
|
||||
|
||||
})();
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
"use strict";
|
||||
|
||||
function MediaTypesEditController($scope, $routeParams, mediaTypeResource, dataTypeResource, editorState, contentEditingHelper, formHelper, navigationService, iconHelper, contentTypeHelper, notificationsService, $filter, $q, localizationService) {
|
||||
|
||||
var vm = this;
|
||||
|
||||
vm.save = save;
|
||||
@@ -96,22 +95,20 @@
|
||||
];
|
||||
|
||||
if ($routeParams.create) {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
//we are creating so get an empty data type item
|
||||
mediaTypeResource.getScaffold($routeParams.id)
|
||||
.then(function (dt) {
|
||||
init(dt);
|
||||
.then(function(dt) {
|
||||
init(dt);
|
||||
|
||||
vm.page.loading = false;
|
||||
});
|
||||
vm.page.loading = false;
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
vm.page.loading = true;
|
||||
|
||||
mediaTypeResource.getById($routeParams.id).then(function (dt) {
|
||||
mediaTypeResource.getById($routeParams.id).then(function(dt) {
|
||||
init(dt);
|
||||
|
||||
syncTreeNode(vm.contentType, dt.path, true);
|
||||
@@ -120,11 +117,9 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ---------- SAVE ---------- */
|
||||
|
||||
function save() {
|
||||
|
||||
var deferred = $q.defer();
|
||||
|
||||
vm.page.saveButtonState = "busy";
|
||||
@@ -165,16 +160,13 @@
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
|
||||
}
|
||||
|
||||
function init(contentType) {
|
||||
|
||||
//get available composite types
|
||||
mediaTypeResource.getAvailableCompositeContentTypes(contentType.id).then(function (result) {
|
||||
contentType.availableCompositeContentTypes = result;
|
||||
|
||||
// convert icons for composite content types
|
||||
// convert legacy icons
|
||||
iconHelper.formatContentTypeIcons(contentType.availableCompositeContentTypes);
|
||||
});
|
||||
|
||||
@@ -189,24 +181,22 @@
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// convert legacy icons
|
||||
convertLegacyIcons(contentType);
|
||||
|
||||
|
||||
// sort properties after sort order
|
||||
angular.forEach(contentType.groups, function (group) {
|
||||
group.properties = $filter('orderBy')(group.properties, 'sortOrder');
|
||||
});
|
||||
|
||||
// convert icons for content type
|
||||
convertLegacyIcons(contentType);
|
||||
|
||||
//set a shared state
|
||||
editorState.set(contentType);
|
||||
|
||||
vm.contentType = contentType;
|
||||
|
||||
}
|
||||
|
||||
function convertLegacyIcons(contentType) {
|
||||
|
||||
// make array to store contentType icon
|
||||
var contentTypeArray = [];
|
||||
|
||||
@@ -218,33 +208,27 @@
|
||||
|
||||
// set icon back on contentType
|
||||
contentType.icon = contentTypeArray[0].icon;
|
||||
|
||||
}
|
||||
|
||||
function getDataTypeDetails(property) {
|
||||
|
||||
if (property.propertyState !== "init") {
|
||||
|
||||
dataTypeResource.getById(property.dataTypeId)
|
||||
.then(function (dataType) {
|
||||
property.dataTypeIcon = dataType.icon;
|
||||
property.dataTypeName = dataType.name;
|
||||
});
|
||||
.then(function(dataType) {
|
||||
property.dataTypeIcon = dataType.icon;
|
||||
property.dataTypeName = dataType.name;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Syncs the content type to it's tree node - this occurs on first load and after saving */
|
||||
function syncTreeNode(dt, path, initialLoad) {
|
||||
|
||||
navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
|
||||
navigationService.syncTree({ tree: "mediatypes", path: path.split(","), forceReload: initialLoad !== true }).then(function(syncArgs) {
|
||||
vm.currentNode = syncArgs.node;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.MediaTypes.EditController", MediaTypesEditController);
|
||||
|
||||
})();
|
||||
|
||||
@@ -140,8 +140,8 @@
|
||||
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
|
||||
<providers>
|
||||
<clear />
|
||||
<add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
|
||||
<add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
|
||||
<add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" />
|
||||
<add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
|
||||
</providers>
|
||||
</membership>
|
||||
<!-- Role Provider -->
|
||||
|
||||
Reference in New Issue
Block a user