diff --git a/.editorconfig b/.editorconfig index bbb5af24d58..1948bc0d730 100644 --- a/.editorconfig +++ b/.editorconfig @@ -83,6 +83,7 @@ dotnet_diagnostic.IDE0130.severity = silent # Na dotnet_style_prefer_conditional_expression_over_assignment = silent # Remove redundant equality, e.g. Disabled == false dotnet_diagnostic.CA2263.severity = warning # Prefer generic overload when type is known +dotnet_diagnostic.CA1816.severity = none # Dispose methods should call SuppressFinalize # Sort using and Import directives with System.* appearing first dotnet_sort_system_directives_first = true diff --git a/README.md b/README.md index a7632bd6576..a11b8fbf669 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Nightly (`main`): [![Build status](https://github.com/OrchardCMS/OrchardCore/actions/workflows/preview_ci.yml/badge.svg)](https://github.com/OrchardCMS/OrchardCore/actions?query=workflow%3A%22Preview+-+CI%22) [![Cloudsmith](https://api-prd.cloudsmith.io/badges/version/orchardcore/preview/nuget/OrchardCore.Application.Cms.Targets/latest/x/?render=true&badge_token=gAAAAABey9hKFD_C-ZIpLvayS3HDsIjIorQluDs53KjIdlxoDz6Ntt1TzvMNJp7a_UWvQbsfN5nS7_0IbxCyqHZsjhmZP6cBkKforo-NqwrH5-E6QCrJ3D8%3D)](https://cloudsmith.io/~orchardcore/repos/preview/packages/detail/nuget/OrchardCore.Application.Cms.Targets/latest/) -## Project Status: v2.1.1 +## Project Status: v2.1.2 The software is production-ready, and capable of serving large mission-critical applications as well, and we're not aware of any fundamental bugs or missing features we deem crucial. Orchard Core continues to evolve, with each version bringing new improvements, and keeping up with the cutting-edge of .NET. diff --git a/mkdocs.yml b/mkdocs.yml index be389953c58..09be16e1e23 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -274,6 +274,7 @@ nav: - Owners: resources/owners/README.md - Workshops: resources/workshops/README.md - Releases: + - 2.1.2: releases/2.1.2.md - 2.1.1: releases/2.1.1.md - 2.1.0: releases/2.1.0.md - 2.0.2: releases/2.0.2.md diff --git a/src/OrchardCore.Modules/OrchardCore.Html/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Html/Migrations.cs index bcd352f7416..7513f0f12b9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Html/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Html/Migrations.cs @@ -91,7 +91,7 @@ public async Task UpdateFrom3Async() lastDocumentId = contentItemVersion.Id; } - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } static bool UpdateBody(JsonNode content) diff --git a/src/OrchardCore.Modules/OrchardCore.Title/Migrations.cs b/src/OrchardCore.Modules/OrchardCore.Title/Migrations.cs index 2d5e1b73d57..e2cbf1b5e6b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Title/Migrations.cs +++ b/src/OrchardCore.Modules/OrchardCore.Title/Migrations.cs @@ -68,7 +68,7 @@ public async Task UpdateFrom1() lastDocumentId = contentItemVersion.Id; } - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } static bool UpdateTitle(JsonNode content) diff --git a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdApplicationStore.cs b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdApplicationStore.cs index f1dabda01ad..02ab4d0e5c2 100644 --- a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdApplicationStore.cs +++ b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdApplicationStore.cs @@ -50,7 +50,7 @@ public virtual async ValueTask CreateAsync(TApplication application, Cancellatio cancellationToken.ThrowIfCancellationRequested(); await _session.SaveAsync(application, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -61,7 +61,7 @@ public virtual async ValueTask DeleteAsync(TApplication application, Cancellatio cancellationToken.ThrowIfCancellationRequested(); _session.Delete(application, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// diff --git a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdAuthorizationStore.cs b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdAuthorizationStore.cs index d48974c4f7d..040915ef6be 100644 --- a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdAuthorizationStore.cs +++ b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdAuthorizationStore.cs @@ -44,7 +44,7 @@ public virtual async ValueTask CreateAsync(TAuthorization authorization, Cancell cancellationToken.ThrowIfCancellationRequested(); await _session.SaveAsync(authorization, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -55,7 +55,7 @@ public virtual async ValueTask DeleteAsync(TAuthorization authorization, Cancell cancellationToken.ThrowIfCancellationRequested(); _session.Delete(authorization, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -319,7 +319,7 @@ public virtual async ValueTask PruneAsync(DateTimeOffset threshold, Cancel try { - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } catch (Exception exception) { @@ -440,7 +440,7 @@ public virtual async ValueTask UpdateAsync(TAuthorization authorization, Cancell try { - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } catch (ConcurrencyException exception) { diff --git a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdScopeStore.cs b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdScopeStore.cs index 2173cf8f254..02893d1e8de 100644 --- a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdScopeStore.cs +++ b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdScopeStore.cs @@ -43,7 +43,7 @@ public virtual async ValueTask CreateAsync(TScope scope, CancellationToken cance cancellationToken.ThrowIfCancellationRequested(); await _session.SaveAsync(scope, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -54,7 +54,7 @@ public virtual async ValueTask DeleteAsync(TScope scope, CancellationToken cance cancellationToken.ThrowIfCancellationRequested(); _session.Delete(scope, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -326,7 +326,7 @@ public virtual async ValueTask UpdateAsync(TScope scope, CancellationToken cance try { - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } catch (ConcurrencyException exception) { diff --git a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdTokenStore.cs b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdTokenStore.cs index eaa3c46165d..8c09a9b6db4 100644 --- a/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdTokenStore.cs +++ b/src/OrchardCore/OrchardCore.OpenId.Core/YesSql/Stores/OpenIdTokenStore.cs @@ -44,7 +44,7 @@ public virtual async ValueTask CreateAsync(TToken token, CancellationToken cance cancellationToken.ThrowIfCancellationRequested(); await _session.SaveAsync(token, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -55,7 +55,7 @@ public virtual async ValueTask DeleteAsync(TToken token, CancellationToken cance cancellationToken.ThrowIfCancellationRequested(); _session.Delete(token, collection: OpenIdCollection); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } /// @@ -354,7 +354,7 @@ public virtual async ValueTask PruneAsync(DateTimeOffset threshold, Cancel try { - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } catch (Exception exception) { @@ -399,7 +399,7 @@ public virtual async ValueTask RevokeByAuthorizationIdAsync(string identif await _session.SaveAsync(token, checkConcurrency: false, collection: OpenIdCollection); } - await _session.SaveChangesAsync(); + await _session.FlushAsync(); return tokens.Count; } @@ -546,7 +546,7 @@ public virtual async ValueTask UpdateAsync(TToken token, CancellationToken cance try { - await _session.SaveChangesAsync(); + await _session.FlushAsync(); } catch (ConcurrencyException exception) { diff --git a/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs b/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs index 741ca54072a..5ed624343ce 100644 --- a/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs +++ b/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs @@ -58,7 +58,6 @@ public UserStore(ISession session, public void Dispose() { - GC.SuppressFinalize(this); } public string NormalizeKey(string key) @@ -111,7 +110,7 @@ public async Task CreateAsync(IUser user, CancellationToken canc } await _session.SaveAsync(user); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); await Handlers.InvokeAsync((handler, context) => handler.CreatedAsync(context), context, _logger); } catch (Exception e) @@ -139,7 +138,7 @@ public async Task DeleteAsync(IUser user, CancellationToken canc } _session.Delete(user); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); await Handlers.InvokeAsync((handler, context) => handler.DeletedAsync(context), context, _logger); } catch (Exception e) @@ -232,7 +231,7 @@ public async Task UpdateAsync(IUser user, CancellationToken canc } await _session.SaveAsync(user); - await _session.SaveChangesAsync(); + await _session.FlushAsync(); await Handlers.InvokeAsync((handler, context) => handler.UpdatedAsync(context), context, _logger); } catch (Exception e) diff --git a/src/docs/README.md b/src/docs/README.md index bc6b84d5ec8..510a0d5d7a8 100644 --- a/src/docs/README.md +++ b/src/docs/README.md @@ -58,7 +58,7 @@ Orchard Core CMS supports all major site building strategies: ## Status -The latest released version of Orchard Core is `2.1.1`. The release notes can be found under [Releases](releases/2.1.1.md). +The latest released version of Orchard Core is `2.1.2`. The release notes can be found under [Releases](releases/2.1.2.md). ## Getting Started diff --git a/src/docs/getting-started/templates/README.md b/src/docs/getting-started/templates/README.md index 7e4bbc485f6..e4fab2dd70a 100644 --- a/src/docs/getting-started/templates/README.md +++ b/src/docs/getting-started/templates/README.md @@ -9,13 +9,13 @@ More information about `dotnet new` can be found at - + ``` diff --git a/src/docs/releases/2.1.1.md b/src/docs/releases/2.1.1.md index 174f7ad47bc..1d673e91fdc 100644 --- a/src/docs/releases/2.1.1.md +++ b/src/docs/releases/2.1.1.md @@ -1,5 +1,5 @@ # Orchard Core 2.1.1 -Release date: November 15, 2024 +Release date: November 25, 2024 This release includes critical bug fixes related to security vulnerabilities. diff --git a/src/docs/releases/2.1.2.md b/src/docs/releases/2.1.2.md new file mode 100644 index 00000000000..873cc93da7a --- /dev/null +++ b/src/docs/releases/2.1.2.md @@ -0,0 +1,5 @@ +# Orchard Core 2.1.2 + +Release date: November 27, 2024 + +This release includes critical bug fixes related to stability. diff --git a/test/OrchardCore.Tests/Apis/GraphQL/ContentItemsFieldTypeTests.cs b/test/OrchardCore.Tests/Apis/GraphQL/ContentItemsFieldTypeTests.cs index a0da2bb775d..141aa7400a3 100644 --- a/test/OrchardCore.Tests/Apis/GraphQL/ContentItemsFieldTypeTests.cs +++ b/test/OrchardCore.Tests/Apis/GraphQL/ContentItemsFieldTypeTests.cs @@ -648,9 +648,7 @@ public void Build() _inner = _services.BuildServiceProvider(); } -#pragma warning disable CA1816 // Dispose methods should call SuppressFinalize public void Dispose() -#pragma warning restore CA1816 // Dispose methods should call SuppressFinalize { (_inner as IDisposable)?.Dispose(); } diff --git a/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs b/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs index 2d4e5a20cfa..68f881118c3 100644 --- a/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs +++ b/test/OrchardCore.Tests/DisplayManagement/Decriptors/DefaultShapeTableManagerTests.cs @@ -495,9 +495,7 @@ public async Task DerivedThemesCanOverrideBaseThemeShapeBindings() Assert.Equal("DerivedTheme", table.Descriptors["OverriddenShape"].BindingSource); } -#pragma warning disable CA1816 // Dispose methods should call SuppressFinalize public void Dispose() -#pragma warning restore CA1816 // Dispose methods should call SuppressFinalize { (_serviceProvider as IDisposable)?.Dispose(); }