From 1e249815765b3ad3e3b15fea9418373a57ff284b Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 5 Feb 2019 19:48:13 +0100 Subject: [PATCH 1/9] Rename umbracoDomains table to umbracoDomain (singular) --- src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs | 1 + .../Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs | 12 ++++++++++++ .../Persistence/Constants-DatabaseSchema.cs | 2 +- .../Repositories/Implement/DomainRepository.cs | 14 +++++++------- src/Umbraco.Core/Umbraco.Core.csproj | 1 + 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs diff --git a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs index 0d0e733591..a9444a0918 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs @@ -126,6 +126,7 @@ namespace Umbraco.Core.Migrations.Upgrade To("{8A027815-D5CD-4872-8B88-9A51AB5986A6}"); // from 7.14.0 To("{ED28B66A-E248-4D94-8CDB-9BDF574023F0}"); To("{38C809D5-6C34-426B-9BEA-EFD39162595C}"); + To("{6017F044-8E70-4E10-B2A3-336949692ADD}"); //FINAL diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs new file mode 100644 index 0000000000..9bbccf368c --- /dev/null +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs @@ -0,0 +1,12 @@ +namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 +{ + public class RenameUmbracoDomainsTable : MigrationBase + { + public RenameUmbracoDomainsTable(IMigrationContext context) : base(context) { } + + public override void Migrate() + { + Rename.Table("umbracoDomains").To(Constants.DatabaseSchema.Tables.Domain).Do(); + } + } +} diff --git a/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs b/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs index 7898a9997a..b874c6e04a 100644 --- a/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs +++ b/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs @@ -40,7 +40,7 @@ namespace Umbraco.Core public const string RelationType = /*TableNamePrefix*/ "umbraco" + "RelationType"; public const string Relation = /*TableNamePrefix*/ "umbraco" + "Relation"; - public const string Domain = /*TableNamePrefix*/ "umbraco" + "Domains"; + public const string Domain = /*TableNamePrefix*/ "umbraco" + "Domain"; public const string Language = /*TableNamePrefix*/ "umbraco" + "Language"; public const string DictionaryEntry = /*TableNamePrefix*/ "cms" + "Dictionary"; public const string DictionaryValue = /*TableNamePrefix*/ "cms" + "LanguageText"; diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs index 01b8bdd66c..69523a860a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs @@ -33,10 +33,10 @@ namespace Umbraco.Core.Persistence.Repositories.Implement protected override IEnumerable PerformGetAll(params int[] ids) { - var sql = GetBaseQuery(false).Where("umbracoDomains.id > 0"); + var sql = GetBaseQuery(false).Where("umbracoDomain.id > 0"); if (ids.Any()) { - sql.Where("umbracoDomains.id in (@ids)", new { ids = ids }); + sql.Where("umbracoDomain.id in (@ids)", new { ids = ids }); } return Database.Fetch(sql).Select(ConvertFromDto); @@ -56,7 +56,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement } else { - sql.Select("umbracoDomains.*, umbracoLanguage.languageISOCode") + sql.Select("umbracoDomain.*, umbracoLanguage.languageISOCode") .From() .LeftJoin() .On(dto => dto.DefaultLanguage, dto => dto.Id); @@ -67,14 +67,14 @@ namespace Umbraco.Core.Persistence.Repositories.Implement protected override string GetBaseWhereClause() { - return "umbracoDomains.id = @id"; + return "umbracoDomain.id = @id"; } protected override IEnumerable GetDeleteClauses() { var list = new List { - "DELETE FROM umbracoDomains WHERE id = @id" + "DELETE FROM umbracoDomain WHERE id = @id" }; return list; } @@ -86,7 +86,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement protected override void PersistNewItem(IDomain entity) { - var exists = Database.ExecuteScalar("SELECT COUNT(*) FROM umbracoDomains WHERE domainName = @domainName", new { domainName = entity.DomainName }); + var exists = Database.ExecuteScalar("SELECT COUNT(*) FROM umbracoDomain WHERE domainName = @domainName", new { domainName = entity.DomainName }); if (exists > 0) throw new DuplicateNameException(string.Format("The domain name {0} is already assigned", entity.DomainName)); if (entity.RootContentId.HasValue) @@ -122,7 +122,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement { ((UmbracoDomain)entity).UpdatingEntity(); - var exists = Database.ExecuteScalar("SELECT COUNT(*) FROM umbracoDomains WHERE domainName = @domainName AND umbracoDomains.id <> @id", + var exists = Database.ExecuteScalar("SELECT COUNT(*) FROM umbracoDomain WHERE domainName = @domainName AND umbracoDomain.id <> @id", new { domainName = entity.DomainName, id = entity.Id }); //ensure there is no other domain with the same name on another entity if (exists > 0) throw new DuplicateNameException(string.Format("The domain name {0} is already assigned", entity.DomainName)); diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 792f1d1223..46d88671f8 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -379,6 +379,7 @@ + From fcec180dc48dc1603758fa75cf369b0c6471c9fa Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Feb 2019 14:54:22 +1100 Subject: [PATCH 2/9] Ship with correct skipIIsCustomeerrors setting --- src/Umbraco.Web.UI/config/umbracoSettings.Release.config | 2 +- src/Umbraco.Web.UI/config/umbracoSettings.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config index eb63fdac7a..1420063cd6 100644 --- a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config +++ b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config @@ -106,7 +106,7 @@ path, eg http://mysite.com/umbraco. NOT just "mysite.com" or "mysite.com/umbraco" or "http://mysite.com". --> diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.config b/src/Umbraco.Web.UI/config/umbracoSettings.config index eb63fdac7a..1420063cd6 100644 --- a/src/Umbraco.Web.UI/config/umbracoSettings.config +++ b/src/Umbraco.Web.UI/config/umbracoSettings.config @@ -106,7 +106,7 @@ path, eg http://mysite.com/umbraco. NOT just "mysite.com" or "mysite.com/umbraco" or "http://mysite.com". --> From ed5023e4319fd8b0119937bfd62e89562721d12d Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Feb 2019 15:13:45 +1100 Subject: [PATCH 3/9] Adds some null checks to Examine's value set builders in case some of the data is strangely incorrect --- src/Umbraco.Examine/ContentValueSetBuilder.cs | 29 ++++++++++--------- src/Umbraco.Examine/MediaValueSetBuilder.cs | 13 +++++---- src/Umbraco.Examine/MemberValueSetBuilder.cs | 13 +++++---- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Examine/ContentValueSetBuilder.cs b/src/Umbraco.Examine/ContentValueSetBuilder.cs index 5e0197765d..44cef08813 100644 --- a/src/Umbraco.Examine/ContentValueSetBuilder.cs +++ b/src/Umbraco.Examine/ContentValueSetBuilder.cs @@ -1,5 +1,6 @@ using Examine; using System.Collections.Generic; +using System.Linq; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; @@ -41,7 +42,7 @@ namespace Umbraco.Examine var urlValue = c.GetUrlSegment(_urlSegmentProviders); //Always add invariant urlName var values = new Dictionary> { - {"icon", c.ContentType.Icon.Yield()}, + {"icon", c.ContentType.Icon?.Yield() ?? Enumerable.Empty()}, {UmbracoExamineIndex.PublishedFieldName, new object[] {c.Published ? "y" : "n"}}, //Always add invariant published value {"id", new object[] {c.Id}}, {UmbracoExamineIndex.NodeKeyFieldName, new object[] {c.Key}}, @@ -51,12 +52,12 @@ namespace Umbraco.Examine {"sortOrder", new object[] {c.SortOrder}}, {"createDate", new object[] {c.CreateDate}}, //Always add invariant createDate {"updateDate", new object[] {c.UpdateDate}}, //Always add invariant updateDate - {"nodeName", PublishedValuesOnly //Always add invariant nodeName - ? c.PublishName.Yield() - : c.Name.Yield()}, - {"urlName", urlValue.Yield()}, //Always add invariant urlName - {"path", c.Path.Yield()}, - {"nodeType", new object[] {c.ContentType.Id}}, + {"nodeName", (PublishedValuesOnly //Always add invariant nodeName + ? c.PublishName?.Yield() + : c?.Name.Yield()) ?? Enumerable.Empty()}, + {"urlName", urlValue?.Yield() ?? Enumerable.Empty()}, //Always add invariant urlName + {"path", c.Path?.Yield() ?? Enumerable.Empty()}, + {"nodeType", c.ContentType.Id.ToString().Yield() ?? Enumerable.Empty()}, {"creatorName", (c.GetCreatorProfile(_userService)?.Name ?? "??").Yield() }, {"writerName",(c.GetWriterProfile(_userService)?.Name ?? "??").Yield() }, {"writerID", new object[] {c.WriterId}}, @@ -72,14 +73,14 @@ namespace Umbraco.Examine { var variantUrl = c.GetUrlSegment(_urlSegmentProviders, culture); var lowerCulture = culture.ToLowerInvariant(); - values[$"urlName_{lowerCulture}"] = variantUrl.Yield(); - values[$"nodeName_{lowerCulture}"] = PublishedValuesOnly - ? c.GetPublishName(culture).Yield() - : c.GetCultureName(culture).Yield(); + values[$"urlName_{lowerCulture}"] = variantUrl?.Yield() ?? Enumerable.Empty(); + values[$"nodeName_{lowerCulture}"] = (PublishedValuesOnly + ? c.GetPublishName(culture)?.Yield() + : c.GetCultureName(culture)?.Yield()) ?? Enumerable.Empty(); values[$"{UmbracoExamineIndex.PublishedFieldName}_{lowerCulture}"] = (c.IsCulturePublished(culture) ? "y" : "n").Yield(); - values[$"updateDate_{lowerCulture}"] = PublishedValuesOnly - ? c.GetPublishDate(culture).Yield() - : c.GetUpdateDate(culture).Yield(); + values[$"updateDate_{lowerCulture}"] = (PublishedValuesOnly + ? c.GetPublishDate(culture) + : c.GetUpdateDate(culture))?.Yield() ?? Enumerable.Empty(); } } diff --git a/src/Umbraco.Examine/MediaValueSetBuilder.cs b/src/Umbraco.Examine/MediaValueSetBuilder.cs index 23d0414d5d..3839d008b3 100644 --- a/src/Umbraco.Examine/MediaValueSetBuilder.cs +++ b/src/Umbraco.Examine/MediaValueSetBuilder.cs @@ -1,5 +1,6 @@ using Examine; using System.Collections.Generic; +using System.Linq; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; @@ -30,7 +31,7 @@ namespace Umbraco.Examine var urlValue = m.GetUrlSegment(_urlSegmentProviders); var values = new Dictionary> { - {"icon", m.ContentType.Icon.Yield()}, + {"icon", m.ContentType.Icon?.Yield() ?? Enumerable.Empty()}, {"id", new object[] {m.Id}}, {UmbracoExamineIndex.NodeKeyFieldName, new object[] {m.Key}}, {"parentID", new object[] {m.Level > 1 ? m.ParentId : -1}}, @@ -39,11 +40,11 @@ namespace Umbraco.Examine {"sortOrder", new object[] {m.SortOrder}}, {"createDate", new object[] {m.CreateDate}}, {"updateDate", new object[] {m.UpdateDate}}, - {"nodeName", m.Name.Yield()}, - {"urlName", urlValue.Yield()}, - {"path", m.Path.Yield()}, - {"nodeType", new object[] {m.ContentType.Id}}, - {"creatorName", m.GetCreatorProfile(_userService).Name.Yield()} + {"nodeName", m.Name?.Yield() ?? Enumerable.Empty()}, + {"urlName", urlValue?.Yield() ?? Enumerable.Empty()}, + {"path", m.Path?.Yield() ?? Enumerable.Empty()}, + {"nodeType", m.ContentType.Id.ToString().Yield() }, + {"creatorName", (m.GetCreatorProfile(_userService)?.Name ?? "??").Yield()} }; foreach (var property in m.Properties) diff --git a/src/Umbraco.Examine/MemberValueSetBuilder.cs b/src/Umbraco.Examine/MemberValueSetBuilder.cs index d9f0b7806d..06fe78105d 100644 --- a/src/Umbraco.Examine/MemberValueSetBuilder.cs +++ b/src/Umbraco.Examine/MemberValueSetBuilder.cs @@ -1,5 +1,6 @@ using Examine; using System.Collections.Generic; +using System.Linq; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; @@ -21,7 +22,7 @@ namespace Umbraco.Examine { var values = new Dictionary> { - {"icon", m.ContentType.Icon.Yield()}, + {"icon", m.ContentType.Icon?.Yield() ?? Enumerable.Empty()}, {"id", new object[] {m.Id}}, {UmbracoExamineIndex.NodeKeyFieldName, new object[] {m.Key}}, {"parentID", new object[] {m.Level > 1 ? m.ParentId : -1}}, @@ -30,11 +31,11 @@ namespace Umbraco.Examine {"sortOrder", new object[] {m.SortOrder}}, {"createDate", new object[] {m.CreateDate}}, {"updateDate", new object[] {m.UpdateDate}}, - {"nodeName", m.Name.Yield()}, - {"path", m.Path.Yield()}, - {"nodeType", new object[] {m.ContentType.Id}}, - {"loginName", m.Username.Yield()}, - {"email", m.Email.Yield()}, + {"nodeName", m.Name?.Yield() ?? Enumerable.Empty()}, + {"path", m.Path?.Yield() ?? Enumerable.Empty()}, + {"nodeType", m.ContentType.Id.ToString().Yield() }, + {"loginName", m.Username?.Yield() ?? Enumerable.Empty()}, + {"email", m.Email?.Yield() ?? Enumerable.Empty()}, }; foreach (var property in m.Properties) From 86b31c278231ad5463a051fd71137aa68687df33 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Feb 2019 15:41:20 +1100 Subject: [PATCH 4/9] fixes test.js to point to the correct karma config --- src/Umbraco.Web.UI.Client/gulp/tasks/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js index e40d4c436a..4c18bff974 100644 --- a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js +++ b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js @@ -11,7 +11,7 @@ var karmaServer = require('karma').Server; // Karma test gulp.task('test:unit', function() { new karmaServer({ - configFile: __dirname + "/test/config/karma.conf.js", + configFile: __dirname + "/../../test/config/karma.conf.js", keepalive: true }) .start(); @@ -19,7 +19,7 @@ gulp.task('test:unit', function() { gulp.task('test:e2e', function() { new karmaServer({ - configFile: __dirname + "/test/config/e2e.js", + configFile: __dirname + "/../../test/config/e2e.js", keepalive: true }) .start(); From 261ddfbcd6cc31f291538ef193f064393f9750c3 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Feb 2019 16:22:29 +1100 Subject: [PATCH 5/9] Gets unit tests running again and added a task `runTests` --- src/Umbraco.Web.UI.Client/gulp/tasks/test.js | 5 ++++- .../test/config/app.unit.js | 18 +++++++++++++----- .../test/config/karma.conf.js | 14 ++++++++------ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js index 4c18bff974..a5a23eb41b 100644 --- a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js +++ b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js @@ -9,7 +9,10 @@ var karmaServer = require('karma').Server; **************************/ // Karma test -gulp.task('test:unit', function() { +gulp.task('runTests', ["js", "test:unit"]); + +gulp.task('test:unit', function () { + new karmaServer({ configFile: __dirname + "/../../test/config/karma.conf.js", keepalive: true diff --git a/src/Umbraco.Web.UI.Client/test/config/app.unit.js b/src/Umbraco.Web.UI.Client/test/config/app.unit.js index 1369ad2145..32b05ab0d4 100644 --- a/src/Umbraco.Web.UI.Client/test/config/app.unit.js +++ b/src/Umbraco.Web.UI.Client/test/config/app.unit.js @@ -1,12 +1,20 @@ var app = angular.module('umbraco', [ - 'umbraco.filters', - 'umbraco.directives', - 'umbraco.resources', - 'umbraco.services', + 'umbraco.filters', + 'umbraco.directives', + 'umbraco.resources', + 'umbraco.services', + 'umbraco.mocks', 'umbraco.interceptors', 'ngRoute', + 'ngAnimate', 'ngCookies', - 'LocalStorageModule' + 'ngSanitize', + + //'ngMessages', + 'tmh.dynamicLocale', + //'ngFileUpload', + //'LocalStorageModule', + //'chart.js' ]); diff --git a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js index 07aa9935a8..cfb4eddb40 100644 --- a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js +++ b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js @@ -24,17 +24,19 @@ module.exports = function (config) { 'node_modules/moment/min/moment-with-locales.js', 'lib/umbraco/Extensions.js', 'node_modules/lazyload-js/lazyload.min.js', + 'node_modules/angular-dynamic-locale/dist/tmhDynamicLocale.min.js', //app bootstrap and loader 'test/config/app.unit.js', //application files - 'src/common/directives/*.js', - 'src/common/filters/*.js', - 'src/common/services/*.js', - 'src/common/interceptors/*.js', - 'src/common/resources/*.js', - 'src/views/**/*.controller.js', + '../Umbraco.Web.UI/Umbraco/js/*.controllers.js', + '../Umbraco.Web.UI/Umbraco/js/*.directives.js', + '../Umbraco.Web.UI/Umbraco/js/*.filters.js', + '../Umbraco.Web.UI/Umbraco/js/*.services.js', + '../Umbraco.Web.UI/Umbraco/js/*.interceptors.js', + '../Umbraco.Web.UI/Umbraco/js/*.security.js', + '../Umbraco.Web.UI/Umbraco/js/*.resources.js', //mocked data and routing 'src/common/mocks/umbraco.servervariables.js', From d76f7db7005b1a23afe71584cb55d759884f49da Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Feb 2019 16:59:25 +1100 Subject: [PATCH 6/9] fixes the runTest build so that it properly builds the babel js and fixes one of the tests --- src/Umbraco.Web.UI.Client/gulp/tasks/test.js | 5 ++++- .../contentpicker/contentpicker.controller.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js index a5a23eb41b..76712f1454 100644 --- a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js +++ b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js @@ -3,13 +3,16 @@ var config = require('../config'); var gulp = require('gulp'); var karmaServer = require('karma').Server; +var runSequence = require('run-sequence'); /************************** * Build tests **************************/ // Karma test -gulp.task('runTests', ["js", "test:unit"]); +gulp.task('runTests', function(cb) { + runSequence(["js"], "test:unit", cb); +}); gulp.task('test:unit', function () { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index 37a97e928c..8b5915026c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -310,12 +310,13 @@ function contentPickerController($scope, entityResource, editorState, iconHelper //need to determine which items we already have loaded var renderModelIds = _.map($scope.renderModel, function (d) { - return $scope.model.config.idType === "udi" ? d.udi : d.id; + return ($scope.model.config.idType === "udi" ? d.udi : d.id).toString(); }); //get the ids that no longer exist var toRemove = _.difference(renderModelIds, valueIds); + //remove the ones that no longer exist for (var j = 0; j < toRemove.length; j++) { var index = renderModelIds.indexOf(toRemove[j]); From 1703c918d97f4270ada1a1ed5947d51fc235e946 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 7 Feb 2019 17:06:50 +1100 Subject: [PATCH 7/9] test pass now --- .../src/views/propertyeditors/rte/rte.controller.js | 4 ++-- .../app/propertyeditors/dropdown-controller.spec.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 960e66edfe..6099c5dad4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -1,6 +1,6 @@ angular.module("umbraco") .controller("Umbraco.PropertyEditors.RTEController", - function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper, editorService, macroService, editorState) { + function ($scope, $q, assetsService, $timeout, tinyMceService, angularHelper) { // TODO: A lot of the code below should be shared between the grid rte and the normal rte @@ -13,7 +13,7 @@ angular.module("umbraco") var n = d.getTime(); $scope.textAreaHtmlId = $scope.model.alias + "_" + n + "_rte"; - var editorConfig = $scope.model.config.editor; + var editorConfig = $scope.model.config ? $scope.model.config.editor : null; if (!editorConfig || angular.isString(editorConfig)) { editorConfig = tinyMceService.defaultPrevalues(); } diff --git a/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/dropdown-controller.spec.js b/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/dropdown-controller.spec.js index 3367db59cf..dba3373ec2 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/dropdown-controller.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/app/propertyeditors/dropdown-controller.spec.js @@ -14,7 +14,7 @@ describe('Drop down controller tests', function () { it('should define the default properties on construction', function () { - controllerFactory('Umbraco.PropertyEditors.DropdownController', { + controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', { $scope: scope, $routeParams: routeParams }); @@ -32,7 +32,7 @@ describe('Drop down controller tests', function () { } }; - controllerFactory('Umbraco.PropertyEditors.DropdownController', { + controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', { $scope: scope, $routeParams: routeParams }); @@ -57,7 +57,7 @@ describe('Drop down controller tests', function () { }; var test = function() { - controllerFactory('Umbraco.PropertyEditors.DropdownController', { + controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', { $scope: scope, $routeParams: routeParams }); @@ -76,7 +76,7 @@ describe('Drop down controller tests', function () { }; var test = function () { - controllerFactory('Umbraco.PropertyEditors.DropdownController', { + controllerFactory('Umbraco.PropertyEditors.DropdownFlexibleController', { $scope: scope, $routeParams: routeParams }); @@ -87,4 +87,4 @@ describe('Drop down controller tests', function () { }); }); -}); \ No newline at end of file +}); From d11fd67a093827e577cab4c685528ea56d1316fb Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 6 Feb 2019 19:04:58 +0100 Subject: [PATCH 8/9] Bugfix PublishedContentTypeFactory --- .../PublishedContentTypeFactory.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs index 8a44a7a9b4..2ca3593b55 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeFactory.cs @@ -87,8 +87,20 @@ namespace Umbraco.Core.Models.PublishedContent { lock (_publishedDataTypesLocker) { - var dataTypes = _dataTypeService.GetAll(ids); - _publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType); + if (_publishedDataTypes == null) + { + var dataTypes = _dataTypeService.GetAll(); + _publishedDataTypes = dataTypes.ToDictionary(x => x.Id, CreatePublishedDataType); + } + else + { + foreach (var id in ids) + _publishedDataTypes.Remove(id); + + var dataTypes = _dataTypeService.GetAll(ids); + foreach (var dataType in dataTypes) + _publishedDataTypes[dataType.Id] = CreatePublishedDataType(dataType); + } } } From f6da7e4444d45f420c50e7a533b89eb66d067201 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 7 Feb 2019 08:19:44 +0100 Subject: [PATCH 9/9] JS error, handle user dialog in the same way as help dialog. Don't close on change of section. Before was a js error with missing method --- .../components/application/umbsections.directive.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js index 5006087ca5..14c9878839 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbsections.directive.js @@ -105,11 +105,6 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se return; } - if (scope.userDialog) { - closeUserDialog(); - } - - navigationService.hideSearch(); navigationService.showTree(section.alias);