From 04b74dddd0d61889064a3fdfd632554fb46350f4 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 1 Aug 2023 14:23:30 +0200 Subject: [PATCH 1/5] Added missing async awaits in notifications that ensures objects are not disposed too early Fixes https://github.com/umbraco/Umbraco-CMS/issues/14574 --- src/Umbraco.Core/Events/EventAggregator.Notifications.cs | 4 ++-- src/Umbraco.Core/Events/EventAggregator.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Events/EventAggregator.Notifications.cs b/src/Umbraco.Core/Events/EventAggregator.Notifications.cs index d298f5bbec..94d4804cd4 100644 --- a/src/Umbraco.Core/Events/EventAggregator.Notifications.cs +++ b/src/Umbraco.Core/Events/EventAggregator.Notifications.cs @@ -137,7 +137,7 @@ internal class NotificationAsyncHandlerWrapperImpl : Notification /// confusion. /// /// - public override Task HandleAsync( + public override async Task HandleAsync( INotification notification, CancellationToken cancellationToken, ServiceFactory serviceFactory, @@ -155,7 +155,7 @@ internal class NotificationAsyncHandlerWrapperImpl : Notification (theNotification, theToken) => x.HandleAsync((TNotification)theNotification, theToken))); - return publish(handlers, notification, cancellationToken); + await publish(handlers, notification, cancellationToken); } } diff --git a/src/Umbraco.Core/Events/EventAggregator.cs b/src/Umbraco.Core/Events/EventAggregator.cs index 277b24eb06..b5de38c66d 100644 --- a/src/Umbraco.Core/Events/EventAggregator.cs +++ b/src/Umbraco.Core/Events/EventAggregator.cs @@ -50,7 +50,7 @@ public partial class EventAggregator : IEventAggregator => _serviceFactory = serviceFactory; /// - public Task PublishAsync(TNotification notification, CancellationToken cancellationToken = default) + public async Task PublishAsync(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification { // TODO: Introduce codegen efficient Guard classes to reduce noise. @@ -60,7 +60,7 @@ public partial class EventAggregator : IEventAggregator } PublishNotification(notification); - return PublishNotificationAsync(notification, cancellationToken); + await PublishNotificationAsync(notification, cancellationToken); } /// From f384e0c30c66e0987e76a1086886077e28affb6e Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Aug 2023 12:39:06 +0200 Subject: [PATCH 2/5] Allow newlines in invite email and escape other html (#14618) --- src/Umbraco.Web.BackOffice/Controllers/UsersController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs index 04e4c64645..1a8be10a5c 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs @@ -597,7 +597,7 @@ public class UsersController : BackOfficeNotificationsController var emailBody = _localizedTextService.Localize("user", "inviteEmailCopyFormat", // Ensure the culture of the found user is used for the email! UmbracoUserExtensions.GetUserCulture(to?.Language, _localizedTextService, _globalSettings), - new[] { userDisplay?.Name, from, message, inviteUri.ToString(), senderEmail }); + new[] { userDisplay?.Name, from, WebUtility.HtmlEncode(message)!.ReplaceLineEndings("
"), inviteUri.ToString(), senderEmail }); // This needs to be in the correct mailto format including the name, else // the name cannot be captured in the email sending notification. From e16e36c68f9d698f640bd5d462c8e9d90278507d Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:20:27 +0000 Subject: [PATCH 3/5] V12: Remove avatar step from login (#14629) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Niels Lyngsø --- .../EmbeddedResources/Lang/bs.xml | 11 +- .../EmbeddedResources/Lang/cs.xml | 3 +- .../EmbeddedResources/Lang/cy.xml | 5 +- .../EmbeddedResources/Lang/da.xml | 5 +- .../EmbeddedResources/Lang/de.xml | 57 +++++---- .../EmbeddedResources/Lang/en.xml | 5 +- .../EmbeddedResources/Lang/en_us.xml | 5 +- .../EmbeddedResources/Lang/es.xml | 3 +- .../EmbeddedResources/Lang/fr.xml | 3 +- .../EmbeddedResources/Lang/hr.xml | 7 +- .../EmbeddedResources/Lang/it.xml | 5 +- .../EmbeddedResources/Lang/nl.xml | 3 +- .../EmbeddedResources/Lang/ru.xml | 3 +- .../EmbeddedResources/Lang/tr.xml | 3 +- .../EmbeddedResources/Lang/ua.xml | 3 +- .../application/umblogin.directive.js | 92 ++------------ .../components/application/umb-login.html | 115 ++++++------------ 17 files changed, 95 insertions(+), 233 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml b/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml index c22086a81a..212840974c 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/bs.xml @@ -1948,7 +1948,7 @@ Da upravljate svojom web lokacijom, jednostavno otvorite Umbraco backoffice i po Novom korisniku je poslana pozivnica s detaljima o tome kako se prijaviti Umbraco. - Pozdrav i dobrodošli u Umbraco! Za samo 1 minut možete krenuti, mi - samo trebate postaviti lozinku i dodati sliku za svoj avatar. - + Pozdrav i dobrodošli u Umbraco! Za samo 1 minut možete krenuti, mi samo trebate postaviti lozinku. Dobrodošli u Umbraco! Nažalost, vaš poziv je istekao. Molimo kontaktirajte svoju administratora i zamolite ih da ga ponovo pošalju. - Ako otpremite svoju fotografiju, drugi korisnici će ga lako prepoznati - ti. Kliknite na krug iznad da otpremite svoju fotografiju. - Pisac Promjena Vaš profil @@ -2296,7 +2291,7 @@ Da upravljate svojom web lokacijom, jednostavno otvorite Umbraco backoffice i po 1: Recommended value --> Makro greške su postavljene na '%0%'. - Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica + Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica na vašem sajtu ako postoje greške u makroima. Ako ovo ispravite, vrijednost će biti postavljena na '%1%'. @@ -2339,7 +2338,7 @@ Was sind Inhaltsvorlagen? - Inhaltsvorlagen sind vordefinierte Inhalte die ausgewählt werden können + Inhaltsvorlagen sind vordefinierte Inhalte die ausgewählt werden können wenn Sie einen neuen Inhaltsknoten anlegen wollen. Wie erstelle ich eine Inhaltsvorlage? @@ -2381,7 +2380,7 @@ Dateien durch Packages erstellen lassen Dateien schreiben Medien Ordner stellen - + Element zurückgegeben Elemente zurückgegeben diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 2e05c3c953..3b7bf261bd 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -2124,14 +2124,11 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Umbraco. Hello there and welcome to Umbraco! In just 1 minute you’ll be good to go, we - just need you to setup a password and add a picture for your avatar. + just need you to setup a password. Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it. - Uploading a photo of yourself will make it easy for other users to recognize - you. Click the circle above to upload your photo. - Writer Change Your profile diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index b24583cd07..44d07b2511 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -2219,14 +2219,11 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Umbraco. Hello there and welcome to Umbraco! In just 1 minute you’ll be good to go, we - just need you to setup a password and add a picture for your avatar. + just need you to setup a password. Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it. - Uploading a photo of yourself will make it easy for other users to recognize - you. Click the circle above to upload your photo. - Writer Configure Two-Factor Change diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml index 4c42c035a5..25f183433a 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml @@ -1394,8 +1394,7 @@ Grupo de usuario ha sido invitado Se ha enviado una invitación al nuevo usuario con detalles sobre cómo acceder a Umbraco. - ¡Hola y bienvenido a Umbraco!. En un minuto todo estará listo para empezar, sólo necesitamos que configures tu contraseña y una imagen para tu avatar. - Sube una foto para que otros usuarios te reconozcan más fácilmente. + ¡Hola y bienvenido a Umbraco!. En un minuto todo estará listo para empezar, sólo necesitamos que configures tu contraseña. Redactor Cambiar Tu perfil diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml index 55dad6e986..604d51f23e 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml @@ -1795,9 +1795,8 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à Groupe d'utilisateurs a été invité Une invitation a été envoyée au nouvel utilisateur avec les détails concernant la connexion à Umbraco. - Bien le bonjour et bienvenue dans Umbraco! Vous serez prêt.e dans moins d'1 minute, vous devez encore simplement configurer votre mot de passe et ajouter une photo pour votre avatar. + Bien le bonjour et bienvenue dans Umbraco! Vous serez prêt.e dans moins d'1 minute, vous devez encore simplement configurer votre mot de passe. Bienvenue dans Umbraco! Malheureusement, votre invitation a expiré. Veuillez contacter votre administrateur et demandez-lui de vous l'envoyer à nouveau. - Chargez une photo afin que les autres utilisateurs puissent vous reconnaître facilement. Cliquez sur le cercle ci-dessus pour charger votre photo. Rédacteur Modifier Votre profil diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml index c3328dfead..b609cf6dee 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/hr.xml @@ -1920,7 +1920,7 @@ Da bi upravljali svojom web lokacijom, jednostavno otvorite Umbraco backoffice i Grupa korisnika je pozvan Novom korisniku je poslana pozivnica s detaljima o tome kako se prijaviti u Umbraco. - Pozdrav i dobrodošli u Umbraco! Jedna minuta bit će vam potrebna da postavite svoju lozinku i dodate svoju profilnu sliku. + Pozdrav i dobrodošli u Umbraco! Jedna minuta bit će vam potrebna da postavite svoju lozinku. Dobrodošli u Umbraco! Nažalost pozivnica je istekla. Molimo kontaktirajte svog administratora i od njega tražite da ju ponovno pošalje. - AAko postavite svoju fotografiju, drugi korisnici će vas lako prepoznati. Kliknite krug iznad da biste prenijeli svoju fotografiju. Pisac Promjeni Vaš profil @@ -2250,7 +2249,7 @@ Da bi upravljali svojom web lokacijom, jednostavno otvorite Umbraco backoffice i 1: Recommended value --> Makro greške su postavljene na '%0%'. - Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica + Greške makroa su postavljene na '%0%' što će spriječiti potpuno učitavanje nekih ili svih stranica na vašem sajtu ako postoje greške u makroima. Ako ovo ispravite, vrijednost će biti postavljena na '%1%'. Expand child items for {{node.name}} From 512199c8ab7a3311cc428c98871d3cf0af02ce50 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 8 Aug 2023 09:40:44 +0200 Subject: [PATCH 5/5] Pass the existing notification state to the ContentUnpublishingNotification so it can be shared. (#14638) --- src/Umbraco.Core/Services/ContentService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index fc02ad3ce1..1d8811ba50 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1542,7 +1542,7 @@ public class ContentService : RepositoryService, IContentService // handling events, business rules, etc // note: StrategyUnpublish flips the PublishedState to Unpublishing! // note: This unpublishes the entire document (not different variants) - unpublishResult = StrategyCanUnpublish(scope, content, eventMessages); + unpublishResult = StrategyCanUnpublish(scope, content, eventMessages, notificationState); if (unpublishResult.Success) { unpublishResult = StrategyUnpublish(content, eventMessages); @@ -3296,10 +3296,10 @@ public class ContentService : RepositoryService, IContentService /// /// /// - private PublishResult StrategyCanUnpublish(ICoreScope scope, IContent content, EventMessages evtMsgs) + private PublishResult StrategyCanUnpublish(ICoreScope scope, IContent content, EventMessages evtMsgs, IDictionary? notificationState) { // raise Unpublishing notification - if (scope.Notifications.PublishCancelable(new ContentUnpublishingNotification(content, evtMsgs))) + if (scope.Notifications.PublishCancelable(new ContentUnpublishingNotification(content, evtMsgs).WithState(notificationState))) { _logger.LogInformation( "Document {ContentName} (id={ContentId}) cannot be unpublished: unpublishing was cancelled.", content.Name, content.Id);