Skip to content

Latest commit

 

History

History
133 lines (94 loc) · 5.76 KB

1.9.0.md

File metadata and controls

133 lines (94 loc) · 5.76 KB

Orchard Core 1.9.0

Release date: Not yet released

Breaking Changes

Drop Newtonsoft.Json Support

Discontinuation of Newtonsoft.Json Support

The utilization of Newtonsoft.Json has been discontinued in both YesSql and OrchardCore. Instead, we have transitioned to utilize System.Text.Json due to its enhanced performance capabilities. To ensure compatibility with System.Text.Json during the serialization or deserialization of objects, the following steps need to be undertaken:

  • If your custom Document includes a collection with a getter-only property, it is imperative to incorporate a setter or utilize the init modifier to facilitate the assignment of values by System.Text.Json. For instance:
public class MediaProfilesDocument : Document
{
    public Dictionary<string, MediaProfile> MediaProfiles { get; } = new(StringComparer.OrdinalIgnoreCase);
}

Will need to be changed to this instead:

public class MediaProfilesDocument : Document
{
    public Dictionary<string, MediaProfile> MediaProfiles { get; init; } = new(StringComparer.OrdinalIgnoreCase);
}
  • If you are using a custom deployment steps, change how you register it by using the new AddDeployment<> extension. This extension adds a new service that is required for proper serialization. For instance, instead of registering your deployment step like this
services.AddTransient<IDeploymentSource, AdminMenuDeploymentSource>();
services.AddSingleton<IDeploymentStepFactory>(new DeploymentStepFactory<AdminMenuDeploymentStep>());
services.AddScoped<IDisplayDriver<DeploymentStep>, AdminMenuDeploymentStepDriver>();

change it to the following

services.AddDeployment<AdminMenuDeploymentSource, AdminMenuDeploymentStep, AdminMenuDeploymentStepDriver>();

Media Indexing

Previously, .PDF file where auto indexed in the search providers (Elasticsearch, Lucene or Azure AI Search). Now, if you want to continue to index .PDF file you'll need to enable OrchardCore.Media.Indexing.Pdf feature.

Additionally, if you needed to enable indexing for text file with .txt, .md extensions, you'll needed OrchardCore.Media.Indexing.Text feature.

If you needed to enable indexing for other extensions like (.docx, or .pptx), you'll needed OrchardCore.Media.Indexing.OpenXML feature.

SMS Module

In the past, we utilized the injection of ISmsProviderfor sending SMS messages. However, in this release, it is now necessary to inject ISmsService instead.

Additionally, Twilio provider is no longer enabled by default. If you want to use Twilio SMS provider, you must enable OrchardCore.Sms.Twilio feature.

Change Logs

Azure AI Search Module

Introducing a new "Azure AI Search" module, designed to empower you in the administration of Azure AI Search indices. When enabled with the "Search" module, it facilitates frontend full-text search capabilities through Azure AI Search. For more info read the Azure AI Search docs.

Deployment Module

Added new extensions to make registering custom deployment step easier

  • services.AddDeployment<TSource, TStep>();
  • services.AddDeployment<TSource, TStep, TDisplayDriver>();
  • services.AddDeploymentWithoutSource<TStep, TDisplayDriver>();

Workflow Module

The method public async Task TriggerEventAsync(string name, IDictionary<string, object> input = null, string correlationId = null, bool isExclusive = false, bool isAlwaysCorrelated = false) was changed to return Task<IEnumerable> instead.

GraphQL Module

When identifying content types for GraphQL exposure, we identify those without a stereotype to provide you with control over the behavior of stereotyped content types. A new option, DiscoverableSterotypes, has been introduced in GraphQLContentOptions. This allows you to specify stereotypes that should be discoverable by default.

For instance, if you have several content types stereotyped as ExampleStereotype, you can make them discoverable by incorporating the following code into the startup class:

services.Configure<GraphQLContentOptions>(options =>
{
    options.DiscoverableSterotypes.Add("ExampleStereotype");
});

Admin

The admin menu has undergone performance enhancements, and new helpers have been added. When incorporating INavigationProvider in your project, you can now utilize NavigationHelper.IsAdminMenu(name) instead of the previous approach using string.Equals(name, "admin", StringComparison.OrdinalIgnoreCase). Moreover, when passing route values to an action, it is advised to store them in a constant variable. An illustrative example is provided below.

public class AdminMenu : INavigationProvider
{
    private static readonly RouteValueDictionary _routeValues = new()
    {
        { "area", "OrchardCore.Settings" },
        { "groupId", AdminSiteSettingsDisplayDriver.GroupId },
    };

    protected readonly IStringLocalizer S;

    public AdminMenu(IStringLocalizer<AdminMenu> stringLocalizer)
    {
        S = stringLocalizer;
    }

    public Task BuildNavigationAsync(string name, NavigationBuilder builder)
    {
        if (!NavigationHelper.IsAdminMenu(name))
        {
            return Task.CompletedTask;
        }

        builder
            .Add(S["Configuration"], configuration => configuration
                .Add(S["Settings"], settings => settings
                    .Add(S["Admin"], S["Admin"].PrefixPosition(), admin => admin
                        .AddClass("admin")
                        .Id("admin")
                        .Action("Index", "Admin", _routeValues)
                        .Permission(PermissionsAdminSettings.ManageAdminSettings)
                        .LocalNav()
                    )
                )
            );

        return Task.CompletedTask;
    }
}