From 6356531207d93424e0051e0fd3346859753d5ec6 Mon Sep 17 00:00:00 2001 From: Jordan Lane Date: Thu, 29 Oct 2015 10:22:34 +0000 Subject: [PATCH 01/23] Focus new folder input automatically http://issues.umbraco.org/issue/U4-7070 --- .../src/views/common/dialogs/mediapicker.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html index 597dcdaa4b..8ea8390154 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html @@ -100,10 +100,11 @@ + on-blur="showFolderInput = false" + focus-when="{{showFolderInput}}"> From 00fc5a5bb2b32e5572024bf55f11e98cca5b69c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:22:20 +0100 Subject: [PATCH 02/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- src/Umbraco.Web.UI.Client/src/less/grid.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/grid.less b/src/Umbraco.Web.UI.Client/src/less/grid.less index 5871412ee2..0c966573de 100644 --- a/src/Umbraco.Web.UI.Client/src/less/grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/grid.less @@ -155,7 +155,7 @@ body { } #speechbubble { - z-index: 1000; + z-index: 1060; position: absolute; bottom: 100px; left: 0; @@ -266,4 +266,4 @@ body { margin-left: 40px; width: 85%!important; } -} \ No newline at end of file +} From 61044b6018e3582e03c48c66ad60cffe3420d759 Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:23:47 +0100 Subject: [PATCH 03/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- src/Umbraco.Web.UI.Client/src/less/main.less | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index fcdc683182..74010962f3 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -148,6 +148,11 @@ h5{ padding-top: 5px; margin-left: 240px; } + +.umb-user-panel .controls-row { + margin-left: 0px; +} + .controls-row label { display: inline-block } @@ -525,4 +530,4 @@ height:1px; margin: 10px 0; overflow: hidden; -} \ No newline at end of file +} From 5cfe9e85f8a4fce24539f6ee7a7249730427b65d Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:27:32 +0100 Subject: [PATCH 04/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- .../views/common/dialogs/user.controller.js | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js index 68579bb442..2002dc4ad9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js @@ -1,5 +1,5 @@ angular.module("umbraco") - .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource) { + .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource, currentUserResource, formHelper) { $scope.history = historyService.getCurrent(); $scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion; @@ -102,4 +102,44 @@ angular.module("umbraco") }); - }); \ No newline at end of file + //create the initial model for change password property editor + $scope.changePasswordModel = { + alias: "_umb_password", + view: "changepassword", + config: {}, + value: {} + }; + + //go get the config for the membership provider and add it to the model + currentUserResource.getMembershipProviderConfig().then(function (data) { + $scope.changePasswordModel.config = data; + //ensure the hasPassword config option is set to true (the user of course has a password already assigned) + //this will ensure the oldPassword is shown so they can change it + $scope.changePasswordModel.config.hasPassword = true; + $scope.changePasswordModel.config.disableToggle = true; + }); + + ////this is the model we will pass to the service + //$scope.profile = {}; + + $scope.changePassword = function () { + + if (formHelper.submitForm({ scope: $scope })) { + currentUserResource.changePassword($scope.changePasswordModel.value).then(function (data) { + + //if the password has been reset, then update our model + if (data.value) { + $scope.changePasswordModel.value.generatedPassword = data.value; + } + + formHelper.resetForm({ scope: $scope, notifications: data.notifications }); + + }, function (err) { + + formHelper.handleError(err); + + }); + } + }; + + }); From f65b0df3e21ee6db7c9068a4ec7b77a23ea92889 Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:28:23 +0100 Subject: [PATCH 05/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- .../src/views/common/dialogs/user.html | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html index 8346acfabb..afd836538a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html @@ -18,18 +18,25 @@
- -
+ + + +
External login providers
@@ -53,7 +60,7 @@ ng-click="unlink($event, login.authType, login.linkedProviderKey)" class="btn btn-block btn-social" ng-class="login.properties.SocialStyle" - id="{{login.authType}}" + id="Button1" name="provider" value="{{login.authType}}"> @@ -63,6 +70,24 @@
+
+
+ +

Change password

+ + + + + + + + +
+
+
    @@ -78,4 +103,4 @@ Umbraco version {{version}}
-
\ No newline at end of file +
From 64518774c6600efcc0d578a0e7e1095564061238 Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:29:24 +0100 Subject: [PATCH 06/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- .../src/views/dashboard/ChangePassword.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/ChangePassword.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/ChangePassword.html index 9588ebd714..7008012a9e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/ChangePassword.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/ChangePassword.html @@ -3,15 +3,16 @@ ng-submit="changePassword()" val-form-manager> -

Change password

+

Change password

- + - From 74dac71e8a2f3deb5cac24ebd1707bcc181a719f Mon Sep 17 00:00:00 2001 From: Tom Pipe Date: Thu, 29 Oct 2015 11:31:53 +0000 Subject: [PATCH 07/23] Fixes U4-6167 - Show path of selected node --- .../propertyeditors/contentpicker/contentpicker.controller.js | 4 ++-- .../views/propertyeditors/contentpicker/contentpicker.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 48f4ed5bda..8c271d096f 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 @@ -150,7 +150,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt if (currIds.indexOf(item.id) < 0) { item.icon = iconHelper.convertFromLegacyIcon(item.icon); - $scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon }); + $scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, path: item.path }); } }; @@ -182,7 +182,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt if (entity) { entity.icon = iconHelper.convertFromLegacyIcon(entity.icon); - $scope.renderModel.push({ name: entity.name, id: entity.id, icon: entity.icon }); + $scope.renderModel.push({ name: entity.name, id: entity.id, icon: entity.icon, path: entity.path }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html index c5de0a69db..1c0f19ca24 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html @@ -6,7 +6,7 @@ ui-sortable ng-model="renderModel"> -
  • +
  • From 308d5ba3443cb25c459972c0a99dc6142ff1174d Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:32:57 +0100 Subject: [PATCH 08/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- src/Umbraco.Web.UI/umbraco/config/lang/nl.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml index 0320df479e..2d5e2c2e2c 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml @@ -985,6 +985,7 @@ Om een vertalingstaak te sluiten, ga aub naar het detailoverzicht en klik op de Gebruikerstype Gebruikerstypes Auteur + Wijzig Je profiel Je recente historie From 4de4eb9cc8cbc6abeea05102df6d6cdf232b7fe1 Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:34:05 +0100 Subject: [PATCH 09/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 8f493d2582..582bb077ef 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -1057,6 +1057,7 @@ To manage your website, simply open the Umbraco back office and start adding con User types Writer Translator + Change Your profile Your recent history Session expires in From 71dc1110d85ca06cd010cd6b5d25cbd8ddbd5fd2 Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:38:00 +0100 Subject: [PATCH 10/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index 69c7e605da..c9dcd1554a 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1055,6 +1055,7 @@ To manage your website, simply open the Umbraco back office and start adding con User types Writer Translator + Change Your profile Your recent history Session expires in From 7b5ad9a5c69f605cdcbdd497c8a66ad06cf4018a Mon Sep 17 00:00:00 2001 From: Jeffrey Schoemaker Date: Thu, 29 Oct 2015 12:44:30 +0100 Subject: [PATCH 11/23] U4-3774 / U4-4752 - Added a change password form to the user dialog --- src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html index afd836538a..7bbc106f98 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html @@ -60,7 +60,7 @@ ng-click="unlink($event, login.authType, login.linkedProviderKey)" class="btn btn-block btn-social" ng-class="login.properties.SocialStyle" - id="Button1" + id="{{login.authType}}" name="provider" value="{{login.authType}}"> From 3f835fe19c11d39aa09a311475e7687416d2f026 Mon Sep 17 00:00:00 2001 From: ryanmcdonough Date: Thu, 29 Oct 2015 12:00:43 +0000 Subject: [PATCH 12/23] RTE now respects CSS Directory AppSetting. Fixes #U4-5617 --- .../src/common/directives/grid/grid.rte.directive.js | 2 +- .../src/views/propertyeditors/rte/rte.controller.js | 3 +-- src/Umbraco.Web/Editors/BackOfficeController.cs | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js index 257901fade..26b9a8f9bd 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js @@ -56,7 +56,7 @@ angular.module("umbraco.directives") if(scope.configuration && scope.configuration.stylesheets){ angular.forEach(scope.configuration.stylesheets, function(stylesheet, key){ - stylesheets.push("/css/" + stylesheet + ".css"); + stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + stylesheet + ".css"); await.push(stylesheetResource.getRulesByName(stylesheet).then(function (rules) { angular.forEach(rules, function (rule) { var r = {}; 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 45812ceef2..80545ff336 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 @@ -64,8 +64,7 @@ angular.module("umbraco") //queue rules loading angular.forEach(editorConfig.stylesheets, function (val, key) { - stylesheets.push("../css/" + val + ".css?" + new Date().getTime()); - + stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + val + ".css?" + new Date().getTime()); await.push(stylesheetResource.getRulesByName(val).then(function (rules) { angular.forEach(rules, function (rule) { var r = {}; diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 689f859462..678e67fb5c 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -341,6 +341,7 @@ namespace Umbraco.Web.Editors string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes) }, {"keepUserLoggedIn", UmbracoConfig.For.UmbracoSettings().Security.KeepUserLoggedIn}, + {"cssPath", IOHelper.ResolveUrl(SystemDirectories.Css).TrimEnd('/')}, } }, { From 1040f234dc9429b79b8d19e601608a797ffc5578 Mon Sep 17 00:00:00 2001 From: ryanmcdonough Date: Thu, 29 Oct 2015 12:09:29 +0000 Subject: [PATCH 13/23] Update grid.rte.directive.js --- .../src/common/directives/grid/grid.rte.directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js index 26b9a8f9bd..d125258157 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js @@ -56,7 +56,7 @@ angular.module("umbraco.directives") if(scope.configuration && scope.configuration.stylesheets){ angular.forEach(scope.configuration.stylesheets, function(stylesheet, key){ - stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + stylesheet + ".css"); + stylesheets.push(Umbraco.Sys.ServerVariables.umbracoSettings.cssPath + "/" + stylesheet + ".css"); await.push(stylesheetResource.getRulesByName(stylesheet).then(function (rules) { angular.forEach(rules, function (rule) { var r = {}; From 6c29ad854c091de8e995472606bd6bcd7c14df5b Mon Sep 17 00:00:00 2001 From: Alejandro Ocampo Date: Thu, 29 Oct 2015 12:48:40 +0000 Subject: [PATCH 14/23] Fixing "U4-6426 CTRL click should open in a new window" --- .../src/common/directives/umbsections.directive.js | 14 ++++++++++++-- .../src/common/directives/umbtreeitem.directive.js | 13 +++++++++++-- .../src/views/directives/umb-sections.html | 6 +++--- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbsections.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbsections.directive.js index dffa973f77..b885dd28ee 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbsections.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbsections.directive.js @@ -94,14 +94,24 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se navigationService.showHelpDialog(); }; - scope.sectionClick = function (section) { + scope.sectionClick = function (event, section) { + + if (event.ctrlKey || + event.shiftKey || + event.metaKey || // apple + (event.button && event.button === 1) // middle click, >IE9 + everyone else + ) { + return; + } + + if (navigationService.userDialog) { navigationService.userDialog.close(); } if (navigationService.helpDialog) { navigationService.helpDialog.close(); } - + navigationService.hideSearch(); navigationService.showTree(section.alias); $location.path("/" + section.alias); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js index c46bca74a5..f8a1284c69 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umbtreeitem.directive.js @@ -40,7 +40,7 @@ angular.module("umbraco.directives") //'' + '' + '' + - '' + + '' + //NOTE: These are the 'option' elipses '' + '
    ' + @@ -148,8 +148,17 @@ angular.module("umbraco.directives") and emits it as a treeNodeSelect element if there is a callback object defined on the tree */ - scope.select = function(n, ev) { + scope.select = function (n, ev) { + if (ev.ctrlKey || + ev.shiftKey || + ev.metaKey || // apple + (ev.button && ev.button === 1) // middle click, >IE9 + everyone else + ) { + return; + } + emitEvent("treeNodeSelect", { element: element, tree: scope.tree, node: n, event: ev }); + ev.preventDefault(); }; /** diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/umb-sections.html b/src/Umbraco.Web.UI.Client/src/views/directives/umb-sections.html index a8ed1749df..d88e208cea 100644 --- a/src/Umbraco.Web.UI.Client/src/views/directives/umb-sections.html +++ b/src/Umbraco.Web.UI.Client/src/views/directives/umb-sections.html @@ -9,7 +9,7 @@
  • {{section.name}} @@ -36,9 +36,9 @@
  • - + {{section.name}}
  • From e9567e7adc420c728dfdc530d0e6468c1610837a Mon Sep 17 00:00:00 2001 From: Tom Pipe Date: Thu, 29 Oct 2015 12:52:36 +0000 Subject: [PATCH 15/23] Fixes U4-6928 - Persist Creator ID of member --- src/Umbraco.Web/Editors/MemberController.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Umbraco.Web/Editors/MemberController.cs b/src/Umbraco.Web/Editors/MemberController.cs index 7d231c46f2..4405f257c4 100644 --- a/src/Umbraco.Web/Editors/MemberController.cs +++ b/src/Umbraco.Web/Editors/MemberController.cs @@ -6,6 +6,7 @@ using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; +using System.Web; using System.Web.Http; using System.Web.Http.ModelBinding; using System.Web.Security; @@ -284,6 +285,9 @@ namespace Umbraco.Web.Editors case ContentSaveAction.SaveNew: MembershipCreateStatus status; CreateWithMembershipProvider(contentItem, out status); + + // save the ID of the creator + contentItem.PersistedContent.CreatorId = Security.CurrentUser.Id; break; default: //we don't support anything else for members From 1ff4fe26dd5dc4bc34203cab053ae2f9cbe470f8 Mon Sep 17 00:00:00 2001 From: Tom Pipe Date: Thu, 29 Oct 2015 16:43:54 +0000 Subject: [PATCH 16/23] Fixes YSOD after send to translation --- src/umbraco.cms/businesslogic/translation/Translation.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/umbraco.cms/businesslogic/translation/Translation.cs b/src/umbraco.cms/businesslogic/translation/Translation.cs index db9d4d4644..1d67e3b9f9 100644 --- a/src/umbraco.cms/businesslogic/translation/Translation.cs +++ b/src/umbraco.cms/businesslogic/translation/Translation.cs @@ -19,13 +19,15 @@ namespace umbraco.cms.businesslogic.translation public static void MakeNew(CMSNode Node, User User, User Translator, Language Language, string Comment, bool IncludeSubpages, bool SendEmail) { + // Get translation taskType for obsolete task constructor + var taskType = ApplicationContext.Current.Services.TaskService.GetTaskTypeById(1); + // Create pending task - Task t = new Task(); + Task t = new Task(new Umbraco.Core.Models.Task(taskType)); t.Comment = Comment; t.Node = Node; t.ParentUser = User; t.User = Translator; - t.Type = new TaskType("toTranslate"); t.Save(); // Add log entry From 61441dd43688fc0559fdb216becd29ab8c8c69de Mon Sep 17 00:00:00 2001 From: Claus Date: Tue, 10 Nov 2015 12:15:44 +0100 Subject: [PATCH 17/23] Fixes: U4-7370 Upgrading from 7.3.1 to 7.4 fails cherrypicked from 7.4.0 branch. Added migration for 7.3.2, ensuring the identity on the table is correct. It failed due to rows initially being inserted with identity disabled and therefore the seed of the table was zero even when the table had data. --- .../EnsureMigrationsTableIdentityIsCorrect.cs | 34 +++++++++++++++++++ .../Repositories/RepositoryBase.cs | 2 +- src/Umbraco.Core/Umbraco.Core.csproj | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs new file mode 100644 index 0000000000..ce70cdc407 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs @@ -0,0 +1,34 @@ +using Umbraco.Core.Configuration; +using Umbraco.Core.Logging; +using Umbraco.Core.Models.Rdbms; +using Umbraco.Core.Persistence.SqlSyntax; + +namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeTwo +{ + /// + /// This reinserts all migrations in the migrations table to account for initial rows inserted + /// on creation without identity enabled. + /// + [Migration("7.3.2", 0, GlobalSettings.UmbracoMigrationName)] + public class EnsureMigrationsTableIdentityIsCorrect : MigrationBase + { + public EnsureMigrationsTableIdentityIsCorrect(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger) + { + } + + public override void Up() + { + Delete.FromTable("umbracoMigration").AllRows(); + var migrations = Context.Database.Fetch(new Sql().Select("*").From(SqlSyntax)); + foreach (var migration in migrations) + { + Insert.IntoTable("umbracoMigration") + .Row(new {name = migration.Name, createDate = migration.CreateDate, version = migration.Version}); + } + } + + public override void Down() + { + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs index f9088e1911..124aaeb035 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs @@ -297,7 +297,7 @@ namespace Umbraco.Core.Persistence.Repositories //If there's a GetAll zero count cache, ensure it is cleared RuntimeCache.ClearCacheItem(GetCacheTypeKey()); } - catch (Exception) + catch (Exception ex) { //if an exception is thrown we need to remove the entry from cache, this is ONLY a work around because of the way // that we cache entities: http://issues.umbraco.org/issue/U4-4259 diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 19e1d3e41e..f8cdcb10c2 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -404,6 +404,7 @@ + From 5d97a94dcbc7ec42a114bee7eabdfc1fd2b564d6 Mon Sep 17 00:00:00 2001 From: Claus Date: Wed, 11 Nov 2015 12:02:12 +0100 Subject: [PATCH 18/23] Fixed to use alias instead of hardcoded id. Added mapper for TaskType. --- .../Persistence/Mappers/TaskTypeMapper.cs | 39 +++++++++++++++++++ src/Umbraco.Core/Umbraco.Core.csproj | 1 + .../businesslogic/translation/Translation.cs | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs diff --git a/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs new file mode 100644 index 0000000000..cb5632ecb5 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs @@ -0,0 +1,39 @@ +using System.Collections.Concurrent; +using Umbraco.Core.Models; +using Umbraco.Core.Models.Rdbms; + +namespace Umbraco.Core.Persistence.Mappers +{ + /// + /// Represents a to DTO mapper used to translate the properties of the public api + /// implementation to that of the database's DTO as sql: [tableName].[columnName]. + /// + //[MapperFor(typeof(ITaskType))] + [MapperFor(typeof(TaskType))] + public sealed class TaskTypeMapper : BaseMapper + { + private static readonly ConcurrentDictionary PropertyInfoCacheInstance = new ConcurrentDictionary(); + + //NOTE: its an internal class but the ctor must be public since we're using Activator.CreateInstance to create it + // otherwise that would fail because there is no public constructor. + public TaskTypeMapper() + { + BuildMap(); + } + + #region Overrides of BaseMapper + + internal override ConcurrentDictionary PropertyInfoCache + { + get { return PropertyInfoCacheInstance; } + } + + internal override void BuildMap() + { + CacheMap(src => src.Id, dto => dto.Id); + CacheMap(src => src.Alias, dto => dto.Alias); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index f8cdcb10c2..07387d2064 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -404,6 +404,7 @@ + diff --git a/src/umbraco.cms/businesslogic/translation/Translation.cs b/src/umbraco.cms/businesslogic/translation/Translation.cs index 1d67e3b9f9..7edbfefadd 100644 --- a/src/umbraco.cms/businesslogic/translation/Translation.cs +++ b/src/umbraco.cms/businesslogic/translation/Translation.cs @@ -20,7 +20,7 @@ namespace umbraco.cms.businesslogic.translation bool IncludeSubpages, bool SendEmail) { // Get translation taskType for obsolete task constructor - var taskType = ApplicationContext.Current.Services.TaskService.GetTaskTypeById(1); + var taskType = ApplicationContext.Current.Services.TaskService.GetTaskTypeByAlias("toTranslate"); // Create pending task Task t = new Task(new Umbraco.Core.Models.Task(taskType)); From f2b3d7c04170c79fe2b624bf524f2e7aab9a902a Mon Sep 17 00:00:00 2001 From: Claus Date: Wed, 11 Nov 2015 12:07:45 +0100 Subject: [PATCH 19/23] Removed commented out line. --- src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs index cb5632ecb5..4399fd323b 100644 --- a/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs @@ -8,7 +8,6 @@ namespace Umbraco.Core.Persistence.Mappers /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// - //[MapperFor(typeof(ITaskType))] [MapperFor(typeof(TaskType))] public sealed class TaskTypeMapper : BaseMapper { From 2ae4ede258b2779ec1767d47dd0fa6b2c354555f Mon Sep 17 00:00:00 2001 From: Claus Date: Thu, 12 Nov 2015 10:55:00 +0100 Subject: [PATCH 20/23] Showing path when hovering nodes should be configurable on the content picker. --- .../contentpicker/contentpicker.controller.js | 4 +++- .../views/propertyeditors/contentpicker/contentpicker.html | 5 +---- .../PropertyEditors/ContentPickerPropertyEditor.cs | 5 ++++- 3 files changed, 8 insertions(+), 6 deletions(-) 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 8c271d096f..222c85fe4d 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 @@ -49,7 +49,8 @@ function contentPickerController($scope, dialogService, entityResource, editorSt //the default pre-values var defaultConfig = { multiPicker: false, - showEditButton: false, + showEditButton: false, + showPathOnHover: false, startNode: { query: "", type: "content", @@ -65,6 +66,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt //Umbraco persists boolean for prevalues as "0" or "1" so we need to convert that! $scope.model.config.multiPicker = ($scope.model.config.multiPicker === "1" ? true : false); $scope.model.config.showEditButton = ($scope.model.config.showEditButton === "1" ? true : false); + $scope.model.config.showPathOnHover = ($scope.model.config.showPathOnHover === "1" ? true : false); var entityType = $scope.model.config.startNode.type === "member" ? "Member" diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html index 1c0f19ca24..68487ceb7a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html @@ -5,11 +5,8 @@