Orchard Core 1.6.0¶
Release date: March 2023
This release contains many bug fixes, performance upgrade, and enhancements. It is recommended to update your existing Orchard Core deployments with this version.
Breaking Changes¶
Users¶
The OrchardCore.Users
module now provides multiple new permissions for added control on user related functions.
In previous versions, the View Users
permission was enough to show the Users
menu item. However, with the newly added permissions, ListUsers
or at least one ListUsersInRole_{0}
variation is required to see the Users
menu. The View Users
permission now only allows you to view a user's profile. The permission ManageUsers
is a super user permission which grants all access to manage users including user settings.
Here is a list of the new permissions:
Permission | Description |
---|---|
ListUsers |
allows listing all users. |
EditUsers |
allow editing any user. |
DeleteUsers |
allows deleting any user. |
The following permissions will be available if the OrchardCore.Roles
feature is enabled:
Permission | Description |
---|---|
AssignRoleToUsers |
allows assigning any role to users. |
ListUsersInRole_{0} |
allows listing users in a given role. |
EditUsersInRole_{0} |
allows editing users in a given role. |
DeleteUsersInRole_{0} |
allows deleting users in a given role. |
AssignRoleToUsers_{0} |
allows assigning users to a given role. |
OrchardCore.Roles
Module¶
As of version 1.6, the default roles are no longer auto created. The setup recipe must define the default roles to be used. The Roles feature will automatically map all known permissions to the defined roles each time a feature is enabled. For more info on creating roles using a recipe, visit the Roles Step documentation.
OrchardCore.Search
Module¶
The property SearchProviderAreaName
in the SearchSettings
class was renamed to ProviderName
. If you are using both Lucene
and Elasticsearch
search providers at the same time, you'll need to update the search settings by setting the default search provider to one of the two.
Additionally, the namespace of the SearchFormViewModel
, SearchIndexViewModel
, and SearchResultViewModel
was changed from OrchardCore.Search.Abstractions.ViewModels
to OrchardCore.Search.ViewModels
.
The namespace of the SearchSettings
class changed from OrchardCore.Search.Model
to OrchardCore.Search.Models
.
Features and Recipes¶
OrchardCore.Features
is no longer auto enabled by OrchardCore.Recipes
as it doesn't depend on it anymore. If you find yourself using recipe services like IRecipeMigrator
in your module, be sure to add a dependency on the OrchardCore.Recipes.Core
feature in your module's Manifest
file to ensures that the recipe services are available before using them.
If your are using setup recipes and want to enable Features
, be sure to explicitly enable the OrchardCore.Features
feature.
Change Logs¶
New OrchardCore.Notifications
Module¶
New feature was added to provide a way to send notification messages to the users. Click here for more info about notifications.
OrchardCore.Contents
Module¶
Prior this release, a user with ViewContent
permission and has access to the dashboard, automatically gets access to "Content Items". Now, to be able to list contents on the dashboard, a user needs ListContent
permission instead.
Setting for TheAdmin
theme¶
New settings were added to the TheAdmin
theme to allow you to make the admin theme responsive based on the screen size.
For example, adding the following settings in the appsettings.json
file will produce the screencasts below:
{
"OrchardCore": {
"TheAdminTheme": {
"StyleSettings": {
"WrapperClasses": "row mb-3",
"LimitedWidthWrapperClasses": "row",
"LimitedWidthClasses": "col-md-6 col-lg-5 col-xxl-4",
"StartClasses": "col-lg-2 col-xl-3",
"EndClasses": "col-lg-10 col-xl-9",
"LabelClasses": "col-form-label text-lg-end col-lg-2 col-xl-3",
"OffsetClasses": "offset-lg-2 offset-xl-3"
}
}
}
}
For a custom part or field editor to work with the new settings, you must update your view to use the new helpers:
- Call the
Orchard.GetInputWrapperCssClasses()
helper to get the proper css classes for the input wrapper. - Call the
Orchard.GetLabelCssClasses()
helper to get the proper css classes for label elements. - Wrap all elements that correspond to the label with an element like
div
to group them. Then use theOrchard.GetEndCssClasses()
helper to get the proper css classes for the newdiv
.
For example, the TitlePart.Edit.cshtml
view was changed from:
<div class="mb-3" asp-validation-class-for="Title">
<label asp-for="Title">@T["Title"]</label>
<input asp-for="Title" class="form-control content-preview-text content-caption-text" disabled="@(Model.Settings?.Options == TitlePartOptions.GeneratedDisabled)" autofocus="autofocus" dir="@culture.GetLanguageDirection()" />
<span asp-validation-for="Title"></span>
@if (!String.IsNullOrWhiteSpace(Model.Settings?.Pattern))
{
switch (Model.Settings?.Options)
{
case TitlePartOptions.Editable:
<span class="hint">@T["Leave empty to auto-generate the title using the pattern."]</span>
break;
case TitlePartOptions.GeneratedDisabled:
<span class="hint">@T["The title will be auto-generated using the pattern."]</span>
break;
}
}
</div>
to the following:
<!-- In the wrapper element we use the GetWrapperCssClasses() helper to get the proper classes. -->
<div class="@Orchard.GetWrapperCssClasses()" asp-validation-class-for="Title">
<!-- The GetLabelCssClasses() helper is used in the label element. -->
<label asp-for="Title" class="@Orchard.GetLabelCssClasses()">@T["Title"]</label>
<!-- This div was added to group the corresponding element. Additionally, GetEndCssClasses() is used to get the proper classes. -->
<div class="@Orchard.GetEndCssClasses()">
<input asp-for="Title" class="form-control content-preview-text content-caption-text" disabled="@(Model.Settings?.Options == TitlePartOptions.GeneratedDisabled)" autofocus="autofocus" dir="@culture.GetLanguageDirection()" />
<span asp-validation-for="Title"></span>
@if (!String.IsNullOrWhiteSpace(Model.Settings?.Pattern))
{
switch (Model.Settings?.Options)
{
case TitlePartOptions.Editable:
<span class="hint">@T["Leave empty to auto-generate the title using the pattern."]</span>
break;
case TitlePartOptions.GeneratedDisabled:
<span class="hint">@T["The title will be auto-generated using the pattern."]</span>
break;
}
}
</div>
</div>
Here is a list of all added helpers:
Helper | Description |
---|---|
Orchard.GetWrapperCssClasses() |
gets the css classes for the wrapper element. |
Orchard.GetLabelCssClasses() |
gets the css classes for a label element. |
Orchard.GetStartCssClasses() |
gets the css classes for a starting section. For example, if you want to push your elements to the end to line it up with a label. |
Orchard.GetEndCssClasses() |
gets the css classes for the ending section. |
Orchard.GetEndCssClasses(bool withOffset) |
gets the css classes for the ending section with optionally an offset. |
Orchard.GetOffsetCssClasses() |
gets the offset classes to align the end elements. |
Orchard.GetLimitedWidthWrapperCssClasses() |
gets the css classes for the limited width element wrapper element. |
Orchard.GetLimitedWidthCssClasses() |
used for a field that has limited width, like the number element. For an example, look at the NumericField.Edit.cshtml view. |
OrchardCore.Search
Module¶
A new Search Form
widget was added to allow you to add a search form as a widget to your site.
In addition to the default /search
path, you can now use /search/{indexName}
where {indexName}
is the name of your search index.
The following views were added as a simpler way to override views as needed:
Search-List.cshtml
renders the search page.Search-Form.cshtml
renders the form of the search form.Search-Results.cshtml
renders the search results after the search is performed.SearchFormPart.cshtml
renders the search form whenSearch Form
is used.
OrchardCore.Search.Elasticsearch
Module¶
All Built-in and custom analyzers are now supported. By default, only the standard
analyzer is available. You may configure the Elasticsearch service to add all the built-in and custom analyzers as needed.
Additionally, a new setting named IndexPrefix
was added to OrchardCore_Elasticsearch
to allow defining a global prefix for all indexes. This is helpful in cases where an environment level index is needed.