From 31655536b1b882aba5b11802f0ef945758c3e215 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Mon, 9 Jan 2023 08:52:46 +0100 Subject: [PATCH 01/15] Implement check for connectionstring value (#13641) Signed-off-by: Zeegaan Signed-off-by: Zeegaan Co-authored-by: Zeegaan --- .../Install/InstallSteps/DatabaseConfigureStep.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs b/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs index 8d2886c223..a988a5f475 100644 --- a/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs +++ b/src/Umbraco.Infrastructure/Install/InstallSteps/DatabaseConfigureStep.cs @@ -36,7 +36,12 @@ public class DatabaseConfigureStep : InstallSetupStep public override Task ExecuteAsync(DatabaseModel databaseSettings) { - if (!_databaseBuilder.ConfigureDatabaseConnection(databaseSettings, false)) + if (databaseSettings is null && string.IsNullOrWhiteSpace(_connectionStrings.CurrentValue.ConnectionString) is false) + { + return Task.FromResult(null); + } + + if (!_databaseBuilder.ConfigureDatabaseConnection(databaseSettings!, false)) { throw new InstallException("Could not connect to the database"); } From 24455bae6ef7aa0f18f625f5c1973babd9ba2d04 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Tue, 10 Jan 2023 10:59:10 +0100 Subject: [PATCH 02/15] Add primary key column attribute to ContentVersionCleanupPolicyDto.cs (#12684) * Add primary key column attribute to ContentVersionCleanupPolicyDto.cs * Test pipelines * Revert "Test pipelines" This reverts commit a8f654ebb7279de9ed83cf99108cb67cb292cbb2. * test commit for pipelines * Revert "test commit for pipelines" This reverts commit ab03f977f4726f2ca40d075877749f4482244604. * Dont cascade delete Signed-off-by: Zeegaan * Remove unneccesary delete clause Signed-off-by: Zeegaan * Remove added whitespace Signed-off-by: Zeegaan * Revert "Remove unneccesary delete clause" This reverts commit 4b2b665169c318a0cd4650c3d6bb13c304d11a4b. * Disable identity for PK * Add PK migration * formatting * Keep latest entry Signed-off-by: Zeegaan Co-authored-by: Zeegaan --- .../Migrations/Upgrade/UmbracoPlan.cs | 4 +++ ...KeyConstrainToContentVersionCleanupDtos.cs | 27 +++++++++++++++++++ .../Dtos/ContentVersionCleanupPolicyDto.cs | 3 ++- .../Implement/ContentTypeRepository.cs | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_5_0/AddPrimaryKeyConstrainToContentVersionCleanupDtos.cs diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs index c80d70fa1f..62a37a8e98 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs @@ -5,6 +5,7 @@ using Umbraco.Cms.Core.Semver; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.Common; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_0_0; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_2_0; +using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_5_0; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_1; using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_1_0; @@ -299,5 +300,8 @@ public class UmbracoPlan : MigrationPlan // To 10.4.0 To("{3F5D492A-A3DB-43F9-A73E-9FEE3B180E6C}"); + + // to 10.5.0 + To("{83AF7945-DADE-4A02-9041-F3F6EBFAC319}"); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_5_0/AddPrimaryKeyConstrainToContentVersionCleanupDtos.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_5_0/AddPrimaryKeyConstrainToContentVersionCleanupDtos.cs new file mode 100644 index 0000000000..331a6fced6 --- /dev/null +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_10_5_0/AddPrimaryKeyConstrainToContentVersionCleanupDtos.cs @@ -0,0 +1,27 @@ +using Umbraco.Cms.Infrastructure.Persistence.Dtos; + +namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_10_5_0; + +public class AddPrimaryKeyConstrainToContentVersionCleanupDtos : MigrationBase +{ + public AddPrimaryKeyConstrainToContentVersionCleanupDtos(IMigrationContext context) : base(context) + { + } + + protected override void Migrate() + { + IEnumerable contentVersionCleanupPolicyDtos = + Database + .Fetch() + .OrderByDescending(x => x.Updated) + .DistinctBy(x => x.ContentTypeId); + + if (TableExists(ContentVersionCleanupPolicyDto.TableName)) + { + Delete.Table(ContentVersionCleanupPolicyDto.TableName).Do(); + } + + Create.Table().Do(); + Database.InsertBatch(contentVersionCleanupPolicyDtos); + } +} diff --git a/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionCleanupPolicyDto.cs b/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionCleanupPolicyDto.cs index da0771df01..128c59594b 100644 --- a/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionCleanupPolicyDto.cs +++ b/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionCleanupPolicyDto.cs @@ -13,7 +13,8 @@ internal class ContentVersionCleanupPolicyDto public const string TableName = Constants.DatabaseSchema.Tables.ContentVersionCleanupPolicy; [Column("contentTypeId")] - [ForeignKey(typeof(ContentTypeDto), Column = "nodeId", OnDelete = Rule.Cascade)] + [PrimaryKeyColumn(AutoIncrement = false)] + [ForeignKey(typeof(ContentTypeDto), Column = "nodeId")] public int ContentTypeId { get; set; } [Column("preventCleanup")] diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs index fd7193e4ae..98ccf0fff8 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs @@ -180,6 +180,7 @@ internal class ContentTypeRepository : ContentTypeRepositoryBase, protected override IEnumerable GetDeleteClauses() { var l = (List)base.GetDeleteClauses(); // we know it's a list + l.Add("DELETE FROM umbracoContentVersionCleanupPolicy WHERE contentTypeId = @id"); l.Add("DELETE FROM cmsDocumentType WHERE contentTypeNodeId = @id"); l.Add("DELETE FROM cmsContentType WHERE nodeId = @id"); l.Add("DELETE FROM umbracoNode WHERE id = @id"); From 42f6717de824c991167a8ae10ab6e057137c7b4c Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 11 Jan 2023 10:02:51 +0100 Subject: [PATCH 03/15] Use the client culture if available when rendering macro HTML for the backoffice (#13653) --- .../Controllers/MacroRenderingController.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs b/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs index a4cb568857..b2261acb2f 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs @@ -125,13 +125,8 @@ public class MacroRenderingController : UmbracoAuthorizedJsonController // When rendering the macro in the backoffice the default setting would be to use the Culture of the logged in user. // Since a Macro might contain thing thats related to the culture of the "IPublishedContent" (ie Dictionary keys) we want - // to set the current culture to the culture related to the content item. This is hacky but it works. - - // fixme - // in a 1:1 situation we do not handle the language being edited - // so the macro renders in the wrong language - - var culture = DomainUtilities.GetCultureFromDomains(publishedContent.Id, publishedContent.Path, null, + // to set the current culture to the currently edited culture with fallback to the culture related to the content item. + var culture = Request.ClientCulture() ?? DomainUtilities.GetCultureFromDomains(publishedContent.Id, publishedContent.Path, null, umbracoContext, _siteDomainHelper); if (culture != null) From 29bc727a4b519d5946fc0bc244cb651af3800ed2 Mon Sep 17 00:00:00 2001 From: Nikolaj Date: Wed, 11 Jan 2023 10:06:39 +0100 Subject: [PATCH 04/15] Bump version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index b5a793d53e..e5676cbd14 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.4.0-rc", + "version": "10.4.0", "assemblyVersion": { "precision": "build" }, From d582632c857430a25c0c0156d3f8d7b69290b2d3 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Fri, 8 Jul 2022 15:33:22 +0200 Subject: [PATCH 05/15] Changed healthcheck collection configuration to use a concrete type to ensure configuration settings are bound. --- .../Configuration/Models/HealthChecksNotificationSettings.cs | 4 ++-- src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs b/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs index 6e81c48c7c..30f6380e81 100644 --- a/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs @@ -39,6 +39,6 @@ public class HealthChecksNotificationSettings /// /// Gets or sets a value for the collection of health checks that are disabled for notifications. /// - public IEnumerable DisabledChecks { get; set; } = - Enumerable.Empty(); + public List DisabledChecks { get; set; } = + new List(); } diff --git a/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs b/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs index 6ae79e9743..638baeb562 100644 --- a/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs @@ -12,8 +12,8 @@ public class HealthChecksSettings /// /// Gets or sets a value for the collection of healthchecks that are disabled. /// - public IEnumerable DisabledChecks { get; set; } = - Enumerable.Empty(); + public List DisabledChecks { get; set; } = + new List(); /// /// Gets or sets a value for the healthcheck notification settings. From daff9884a3d0ff0a90d0cde23b7565919647d5fe Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Fri, 8 Jul 2022 15:33:22 +0200 Subject: [PATCH 06/15] Changed healthcheck collection configuration to use a concrete type to ensure configuration settings are bound. --- .../Configuration/Models/HealthChecksNotificationSettings.cs | 4 ++-- src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs b/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs index 6e81c48c7c..30f6380e81 100644 --- a/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/HealthChecksNotificationSettings.cs @@ -39,6 +39,6 @@ public class HealthChecksNotificationSettings /// /// Gets or sets a value for the collection of health checks that are disabled for notifications. /// - public IEnumerable DisabledChecks { get; set; } = - Enumerable.Empty(); + public List DisabledChecks { get; set; } = + new List(); } diff --git a/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs b/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs index 6ae79e9743..638baeb562 100644 --- a/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/HealthChecksSettings.cs @@ -12,8 +12,8 @@ public class HealthChecksSettings /// /// Gets or sets a value for the collection of healthchecks that are disabled. /// - public IEnumerable DisabledChecks { get; set; } = - Enumerable.Empty(); + public List DisabledChecks { get; set; } = + new List(); /// /// Gets or sets a value for the healthcheck notification settings. From ba74ca0512e1c0f6ab5ea52ec04019bf3c26c947 Mon Sep 17 00:00:00 2001 From: Nikolaj Date: Wed, 11 Jan 2023 15:37:27 +0100 Subject: [PATCH 07/15] Bump version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index e5676cbd14..8fc9e69f4e 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.4.0", + "version": "10.5.0-rc", "assemblyVersion": { "precision": "build" }, From 0c694c4b9d269fccaa81c7b0411fd158fe8f21a3 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 12 Jan 2023 10:47:27 +0100 Subject: [PATCH 08/15] Fix broken buttons for properties with alias "navigation" (#13663) --- .../blocklist/umb-block-list-property-editor.html | 2 +- .../mediapicker3/umb-media-picker3-property-editor.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html index a13826b86b..6463f41b37 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umb-block-list-property-editor.html @@ -31,7 +31,7 @@
From 2ec05431ba83929d10261bc63356037e79e9fd9c Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 12 Jan 2023 10:49:30 +0100 Subject: [PATCH 10/15] Fix the content picker XPATH scope in infinite editing (#13657) --- .../propertyeditors/contentpicker/contentpicker.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 992c01c750..09b9d2c98b 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 @@ -246,7 +246,7 @@ function contentPickerController($scope, $q, $routeParams, $location, entityReso } else if ($scope.model.config.startNode.query) { //if we have a query for the startnode, we will use that. - var rootId = $routeParams.id; + var rootId = editorState.current.id; entityResource.getByQuery($scope.model.config.startNode.query, rootId, "Document").then(function (ent) { dialogOptions.startNodeId = ($scope.model.config.idType === "udi" ? ent.udi : ent.id).toString(); }); From 4e7f6635968a719a79f3cc1052a183035159d41d Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 12 Jan 2023 10:51:23 +0100 Subject: [PATCH 11/15] Use element type icon colors in block list catalogue, unless a specific color has been defined for catalogue appearance (#13651) --- .../views/components/blockcard/umbBlockCard.component.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umbBlockCard.component.js b/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umbBlockCard.component.js index bb4c8c2a08..6d6872c1e7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umbBlockCard.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umbBlockCard.component.js @@ -30,7 +30,11 @@ }; vm.$onChanges = function () { - vm.icon = vm.elementTypeModel ? vm.elementTypeModel.icon.split(" ")[0] : 'icon-block'; + vm.icon = vm.elementTypeModel ? vm.elementTypeModel.icon : 'icon-block'; + if (vm.blockConfigModel.iconColor) { + // enforce configured icon color for catalogue appearance instead of icon color from element type + vm.icon = vm.icon.split(" ")[0]; + } }; vm.$onDestroy = function () { From 6f2016d6daedbe62d84d5968378fafcb10683d9f Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 12 Jan 2023 10:53:14 +0100 Subject: [PATCH 12/15] Only save selected variant for new content (#13649) --- .../src/views/content/overlays/save.controller.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/overlays/save.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/overlays/save.controller.js index 812a461aee..308673bf21 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/overlays/save.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/overlays/save.controller.js @@ -64,7 +64,6 @@ function onInit() { vm.variants = $scope.model.variants; vm.availableVariants = vm.variants.filter(saveableVariantFilter); - vm.isNew = vm.variants.some(variant => variant.state === 'NotCreated'); if (!$scope.model.title) { localizationService.localize("content_readyToSave").then(value => { @@ -78,7 +77,7 @@ variant.save = variant.publish = false; variant.isMandatory = isMandatoryFilter(variant); - if(vm.isNew && hasAnyData(variant) && allowUpdate(variant)) { + if(variant.state === 'NotCreated' && hasAnyData(variant) && allowUpdate(variant)) { variant.save = true; } }); From 9d522ea9a0bbdd84a3da34493e4ecc126672a40d Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 12 Jan 2023 10:53:57 +0100 Subject: [PATCH 13/15] Make it possible to drag multiple properties to other tabs in succession (#13579) --- .../common/directives/components/umbgroupsbuilder.directive.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js index 9a116beb5a..41d40a4615 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js @@ -158,6 +158,9 @@ items: ".umb-group-builder__property-sortable", stop: (e, ui) => { updatePropertiesSortOrder(); + + // when a property is dropped we need to reset the requested tab hover alias + scope.sortableRequestedTabAlias = undefined; } }; From f6113db0fc9da3579b200121fc2d7234012d9e96 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 12 Jan 2023 10:56:14 +0100 Subject: [PATCH 14/15] Re-introduce the option to conditionally login members after registration (#13659) * Re-introduce the option to conditionally login members after registration * Make absolutely sure the default is true for automatic member login after registration --- .../EmbeddedResources/Snippets/RegisterMember.cshtml | 6 +++++- .../Controllers/UmbRegisterController.cs | 11 ++++++++--- src/Umbraco.Web.Website/Models/RegisterModel.cs | 6 ++++++ .../Models/RegisterModelBuilder.cs | 8 ++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Snippets/RegisterMember.cshtml b/src/Umbraco.Core/EmbeddedResources/Snippets/RegisterMember.cshtml index ca45ff5746..f3b9e31254 100644 --- a/src/Umbraco.Core/EmbeddedResources/Snippets/RegisterMember.cshtml +++ b/src/Umbraco.Core/EmbeddedResources/Snippets/RegisterMember.cshtml @@ -18,6 +18,9 @@ // Set to true if you want the member editable properties shown. // It will only displays properties marked as "Member can edit" on the "Info" tab of the Member Type. .WithCustomProperties(false) + // By default the member will be logged in automatically after registration. + // Set this to false if the member should not be logged in automatically. + .WithAutomaticLogIn(true) .Build(); var success = TempData["FormSuccess"] != null; @@ -39,7 +42,8 @@ else new { MemberTypeAlias = registerModel.MemberTypeAlias, UsernameIsEmail = registerModel.UsernameIsEmail, - RedirectUrl = registerModel.RedirectUrl + RedirectUrl = registerModel.RedirectUrl, + AutomaticLogIn = registerModel.AutomaticLogIn })) {

Create a new account.

diff --git a/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs b/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs index 9261b356f8..493dd624d1 100644 --- a/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs +++ b/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs @@ -95,6 +95,12 @@ public class UmbRegisterController : SurfaceController { model.UsernameIsEmail = usernameIsEmail.ToString() == "True"; } + + if (RouteData.Values.TryGetValue(nameof(RegisterModel.AutomaticLogIn), out var automaticLogin) && + automaticLogin != null) + { + model.AutomaticLogIn = automaticLogin.ToString() == "True"; + } } private void AddErrors(IdentityResult result) @@ -109,9 +115,8 @@ public class UmbRegisterController : SurfaceController /// Registers a new member. ///
/// Register member model. - /// Flag for whether to log the member in upon successful registration. /// Result of registration operation. - private async Task RegisterMemberAsync(RegisterModel model, bool logMemberIn = true) + private async Task RegisterMemberAsync(RegisterModel model) { using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); @@ -149,7 +154,7 @@ public class UmbRegisterController : SurfaceController _memberService.Save(member); - if (logMemberIn) + if (model.AutomaticLogIn) { await _memberSignInManager.SignInAsync(identityUser, false); } diff --git a/src/Umbraco.Web.Website/Models/RegisterModel.cs b/src/Umbraco.Web.Website/Models/RegisterModel.cs index 3717ef3e7d..3e23d4d002 100644 --- a/src/Umbraco.Web.Website/Models/RegisterModel.cs +++ b/src/Umbraco.Web.Website/Models/RegisterModel.cs @@ -13,6 +13,7 @@ public class RegisterModel : PostRedirectModel MemberTypeAlias = Constants.Conventions.MemberTypes.DefaultAlias; UsernameIsEmail = true; MemberProperties = new List(); + AutomaticLogIn = true; } [Required] @@ -59,4 +60,9 @@ public class RegisterModel : PostRedirectModel /// Flag to determine if the username should be the email address, if true then the Username property is ignored ///
public bool UsernameIsEmail { get; set; } + + /// + /// Flag to determine if the member should be logged in automatically after successful registration + /// + public bool AutomaticLogIn { get; set; } } diff --git a/src/Umbraco.Web.Website/Models/RegisterModelBuilder.cs b/src/Umbraco.Web.Website/Models/RegisterModelBuilder.cs index b3736e63e8..0b3e73fe73 100644 --- a/src/Umbraco.Web.Website/Models/RegisterModelBuilder.cs +++ b/src/Umbraco.Web.Website/Models/RegisterModelBuilder.cs @@ -14,6 +14,7 @@ public class RegisterModelBuilder : MemberModelBuilderBase private string? _memberTypeAlias; private string? _redirectUrl; private bool _usernameIsEmail; + private bool _automaticLogIn = true; public RegisterModelBuilder(IMemberTypeService memberTypeService, IShortStringHelper shortStringHelper) : base(memberTypeService, shortStringHelper) @@ -44,6 +45,12 @@ public class RegisterModelBuilder : MemberModelBuilderBase return this; } + public RegisterModelBuilder WithAutomaticLogIn(bool automaticLogIn = true) + { + _automaticLogIn = automaticLogIn; + return this; + } + public RegisterModel Build() { var providedOrDefaultMemberTypeAlias = _memberTypeAlias ?? Constants.Conventions.MemberTypes.DefaultAlias; @@ -62,6 +69,7 @@ public class RegisterModelBuilder : MemberModelBuilderBase MemberProperties = _lookupProperties ? GetMemberPropertiesViewModel(memberType) : Enumerable.Empty().ToList(), + AutomaticLogIn = _automaticLogIn }; return model; } From ea3668a2245e0da5ded6e71a4e519ded793b498e Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 16 Jan 2023 16:10:06 +0100 Subject: [PATCH 15/15] Update docfx (#13679) --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index e4d751b51b..068d55107c 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -147,7 +147,7 @@ stages: inputs: targetType: inline script: | - choco install docfx --version=2.59.2 -y + choco install docfx --version=2.59.4 -y if ($lastexitcode -ne 0){ throw ("Error installing DocFX") }