From 87c06f5f9840acdd1d89d44913125d90012515c7 Mon Sep 17 00:00:00 2001
From: Sebastiaan Janssen
Date: Mon, 19 Sep 2022 16:14:16 +0200
Subject: [PATCH] Back to 10.2.0-ish
---
.github/workflows/codeql-analysis.yml | 3 +-
Directory.Build.props | 2 +-
build/azure-pipelines.yml | 113 +-
src/Directory.Build.props | 15 +-
src/JsonSchema/JsonSchema.csproj | 2 +-
.../Install/InstallControllerBase.cs | 15 -
.../Install/SettingsInstallController.cs | 43 -
.../Install/SetupInstallController.cs | 47 -
.../ValidateDatabaseInstallController.cs | 52 -
.../Controllers/NewInstallController.cs | 111 +
.../Server/ServerControllerBase.cs | 13 -
.../Server/StatusServerController.cs | 21 -
.../Server/VersionServerController.cs | 22 -
.../Upgrade/AuthorizeUpgradeController.cs | 24 -
.../Upgrade/UpgradeControllerBase.cs | 18 -
...radeController.cs => UpgradeController.cs} | 28 +-
.../ManagementApiComposer.cs | 3 +-
.../Umbraco.Cms.ManagementApi.csproj | 2 +-
.../ViewModels/Pagination/PagedViewModel.cs | 8 -
.../Server/ServerStatusViewModel.cs | 10 -
.../ViewModels/Server/VersionViewModel.cs | 6 -
.../Umbraco.Cms.Persistence.SqlServer.csproj | 2 +-
.../Umbraco.Cms.Persistence.Sqlite.csproj | 3 +-
.../Umbraco.Cms.StaticAssets.csproj | 2 +-
src/Umbraco.Cms/Umbraco.Cms.csproj | 2 +-
src/Umbraco.Core/Composing/IUserComposer.cs | 9 +
.../ConfigureConnectionStrings.cs | 7 +-
.../Configuration/Models/ContentSettings.cs | 7 -
.../Models/RequestHandlerSettings.cs | 61 +-
.../Configuration/Models/SecuritySettings.cs | 11 +-
.../Validation/ContentSettingsValidator.cs | 2 +-
.../Validation/GlobalSettingsValidator.cs | 2 +-
.../HealthChecksSettingsValidator.cs | 2 +-
.../RequestHandlerSettingsValidator.cs | 2 +-
.../Validation/UnattendedSettingsValidator.cs | 4 +-
src/Umbraco.Core/Constants-Conventions.cs | 62 +
.../ServiceCollectionExtensions.cs | 11 +-
.../UmbracoBuilder.CollectionBuilders.cs | 6 +-
.../UmbracoBuilder.Collections.cs | 8 +
.../UmbracoBuilder.Configuration.cs | 15 +-
.../DependencyInjection/UmbracoBuilder.cs | 3 +-
.../EmbeddedResources/Lang/cs.xml | 12 +-
.../EmbeddedResources/Lang/cy.xml | 20 +-
.../EmbeddedResources/Lang/da.xml | 6 +-
.../EmbeddedResources/Lang/en.xml | 20 +-
.../EmbeddedResources/Lang/en_us.xml | 30 +-
.../EmbeddedResources/Lang/es.xml | 2 +-
.../EmbeddedResources/Lang/fr.xml | 8 +-
.../EmbeddedResources/Lang/he.xml | 2 +-
.../EmbeddedResources/Lang/it.xml | 16 +-
.../EmbeddedResources/Lang/ja.xml | 8 +-
.../EmbeddedResources/Lang/ko.xml | 2 +-
.../EmbeddedResources/Lang/nb.xml | 2 +-
.../EmbeddedResources/Lang/nl.xml | 12 +-
.../EmbeddedResources/Lang/pt.xml | 2 +-
.../EmbeddedResources/Lang/sv.xml | 2 +-
.../EmbeddedResources/Lang/tr.xml | 12 +-
.../EmbeddedResources/Lang/zh.xml | 2 +-
.../EmbeddedResources/Lang/zh_tw.xml | 4 +-
src/Umbraco.Core/Extensions/EnumExtensions.cs | 55 +-
.../RequestHandlerSettingsExtension.cs | 40 +-
.../Extensions/StringExtensions.cs | 7 +-
.../Checks/Security/BaseHttpHeaderCheck.cs | 12 +
.../Hosting/IHostingEnvironment.cs | 2 +-
src/Umbraco.Core/IO/IOHelper.cs | 15 +-
src/Umbraco.Core/IO/IOHelperLinux.cs | 2 +
src/Umbraco.Core/IO/IOHelperOSX.cs | 2 +
src/Umbraco.Core/IO/IOHelperWindows.cs | 29 +
src/Umbraco.Core/IO/ViewHelper.cs | 20 +-
.../InstallSteps/TelemetryIdentifierStep.cs | 19 +-
.../Media/EmbedProviders/DailyMotion.cs | 2 +-
.../Media/EmbedProviders/EmbedProviderBase.cs | 2 +-
.../Media/EmbedProviders/Flickr.cs | 2 +-
.../Media/EmbedProviders/GettyImages.cs | 2 +-
.../Media/EmbedProviders/Giphy.cs | 2 +-
src/Umbraco.Core/Media/EmbedProviders/Hulu.cs | 2 +-
.../Media/EmbedProviders/Issuu.cs | 2 +-
.../Media/EmbedProviders/Kickstarter.cs | 2 +-
.../Media/EmbedProviders/Slideshare.cs | 2 +-
.../Media/EmbedProviders/SoundCloud.cs | 2 +-
src/Umbraco.Core/Media/EmbedProviders/Ted.cs | 2 +-
.../Media/EmbedProviders/Twitter.cs | 2 +-
.../Media/EmbedProviders/Vimeo.cs | 2 +-
.../Media/EmbedProviders/Youtube.cs | 2 +-
.../Models/ChangingPasswordModel.cs | 2 +-
.../UserGroupPermissionsSave.cs | 11 +-
src/Umbraco.Core/Models/ContentType.cs | 2 +-
src/Umbraco.Core/Models/IContentType.cs | 19 +-
src/Umbraco.Core/Models/Language.cs | 22 +-
.../Mapping/ContentTypeMapDefinition.cs | 153 +-
.../Models/Mapping/ContentVariantMapper.cs | 37 +-
.../Models/Mapping/DictionaryMapDefinition.cs | 10 +-
.../Mapping/MemberTabsAndPropertiesMapper.cs | 3 +-
.../PublishedContent/PublishedContentType.cs | 24 +
src/Umbraco.Core/Models/RelationType.cs | 11 +-
src/Umbraco.Core/Models/SendCodeViewModel.cs | 6 +-
src/Umbraco.Core/Models/SetPasswordModel.cs | 6 +-
src/Umbraco.Core/Models/UnLinkLoginModel.cs | 6 +-
...icationComponentsInstallingNotification.cs | 27 +
...oApplicationMainDomAcquiredNotification.cs | 23 +
.../UmbracoApplicationStartingNotification.cs | 37 +-
.../UmbracoApplicationStoppingNotification.cs | 27 +-
.../Repositories/IExternalLoginRepository.cs | 26 +
.../Repositories/IMacroRepository.cs | 7 +-
.../Repositories/IMacroWithAliasRepository.cs | 11 +
.../Repositories/IMemberRepository.cs | 16 +
.../Repositories/IUserRepository.cs | 10 +-
.../ContentPickerPropertyEditor.cs | 3 +-
.../PropertyEditors/DataEditor.cs | 20 +-
.../PropertyEditors/DataEditorAttribute.cs | 6 -
.../PropertyEditors/DecimalPropertyEditor.cs | 3 +-
.../EyeDropperColorPickerPropertyEditor.cs | 3 +-
.../PropertyEditors/IntegerPropertyEditor.cs | 3 +-
.../PropertyEditors/LabelPropertyEditor.cs | 3 +-
.../PropertyEditors/MarkdownPropertyEditor.cs | 3 +-
.../MemberGroupPickerPropertyEditor.cs | 3 +-
.../MemberPickerPropertyEditor.cs | 3 +-
.../PropertyValueConverterBase.cs | 2 +-
.../UserPickerPropertyEditor.cs | 3 +-
.../Routing/DefaultUrlProvider.cs | 45 +-
.../Services/CultureImpactFactory.cs | 22 +-
.../Services/EntityXmlSerializer.cs | 2 +-
.../Services/ExternalLoginService.cs | 33 +-
.../Services/IExternalLoginService.cs | 63 +
src/Umbraco.Core/Services/IMacroService.cs | 9 +-
.../Services/IMacroWithAliasService.cs | 14 +
.../Services/IMembershipMemberService.cs | 14 +
.../Services/ITwoFactorLoginService.cs | 12 +-
.../Services/LocalizedTextService.cs | 31 +-
src/Umbraco.Core/Services/MacroService.cs | 8 +-
src/Umbraco.Core/Services/MemberService.cs | 6 +-
src/Umbraco.Core/Services/ServiceContext.cs | 10 +-
.../Services/TwoFactorLoginService.cs | 19 +-
src/Umbraco.Core/Services/UserService.cs | 7 +-
src/Umbraco.Core/Umbraco.Core.csproj | 13 +-
src/Umbraco.Core/Web/IRequestAccessor.cs | 4 +-
.../WebAssets/IRuntimeMinifier.cs | 50 +-
.../ConfigureIndexOptions.cs | 2 +-
.../Umbraco.Examine.Lucene.csproj | 4 +-
.../Configuration/JsonConfigManipulator.cs | 9 +-
.../UmbracoBuilder.Repositories.cs | 3 +-
.../UmbracoBuilder.Services.cs | 2 +-
.../RecurringHostedServiceBase.cs | 7 +
.../HostedServices/ReportSiteTask.cs | 20 +-
.../Enrichers/ThreadAbortExceptionEnricher.cs | 6 +-
.../Logging/Viewer/ILogViewer.cs | 9 +-
.../Viewer/SerilogLogViewerSourceBase.cs | 21 +-
.../Alter/Table/AlterTableBuilder.cs | 2 +-
.../Install/DatabaseSchemaCreator.cs | 41 +-
.../Install/DatabaseSchemaCreatorFactory.cs | 39 +-
.../Upgrade/V_8_0_0/AddTypedLabels.cs | 14 +-
.../AutomaticPackageMigrationPlan.cs | 6 +-
.../Packaging/PackageDataInstallation.cs | 4 +-
.../Packaging/PackageMigrationBase.cs | 45 +-
.../Implement/ContentTypeRepository.cs | 2 +-
.../Implement/ExternalLoginRepository.cs | 15 +-
.../Repositories/Implement/MacroRepository.cs | 2 +-
.../Implement/MemberRepository.cs | 7 +
.../BlockListPropertyEditor.cs | 3 +-
.../CheckBoxListPropertyEditor.cs | 3 +-
.../ColorPickerPropertyEditor.cs | 3 +-
.../PropertyEditors/DateTimePropertyEditor.cs | 3 +-
.../DropDownFlexiblePropertyEditor.cs | 3 +-
.../EmailAddressPropertyEditor.cs | 3 +-
.../FileUploadPropertyEditor.cs | 3 +-
.../PropertyEditors/GridPropertyEditor.cs | 3 +-
.../ImageCropperPropertyEditor.cs | 3 +-
.../PropertyEditors/ListViewPropertyEditor.cs | 3 +-
.../MediaPicker3PropertyEditor.cs | 3 +-
.../MediaPickerPropertyEditor.cs | 3 +-
.../MultiNodeTreePickerPropertyEditor.cs | 3 +-
.../MultiUrlPickerPropertyEditor.cs | 3 +-
.../MultipleTextStringPropertyEditor.cs | 3 +-
.../NestedContentPropertyEditor.cs | 3 +-
.../RadioButtonsPropertyEditor.cs | 3 +-
.../PropertyEditors/RichTextPropertyEditor.cs | 3 +-
.../PropertyEditors/SliderPropertyEditor.cs | 3 +-
.../PropertyEditors/TagsPropertyEditor.cs | 3 +-
.../PropertyEditors/TextAreaPropertyEditor.cs | 3 +-
.../PropertyEditors/TextboxPropertyEditor.cs | 3 +-
.../TrueFalsePropertyEditor.cs | 3 +-
.../Runtime/CoreRuntime.cs | 14 +-
.../BackOfficeClaimsPrincipalFactory.cs | 4 +-
.../Security/BackOfficeErrorDescriber.cs | 4 +-
.../Security/BackOfficeUserStore.cs | 100 +-
.../Security/ClaimsIdentityExtensions.cs | 4 +-
.../Security/IUmbracoUserManager.cs | 28 +-
.../Security/MemberRoleStore.cs | 47 +-
.../Security/MemberUserStore.cs | 109 +-
.../Security/NoOpLookupNormalizer.cs | 4 +-
.../Security/UmbracoErrorDescriberBase.cs | 4 +-
.../Security/UmbracoIdentityRole.cs | 14 +-
.../Security/UmbracoIdentityUser.cs | 6 +-
.../Security/UmbracoUserManager.cs | 14 +-
.../Security/UmbracoUserStore.cs | 14 +-
.../Templates/HtmlMacroParameterParser.cs | 2 +-
.../Umbraco.Infrastructure.csproj | 22 +-
.../Umbraco.New.Cms.Core.csproj | 2 +-
.../Umbraco.New.Cms.Infrastructure.csproj | 2 +-
.../Installer/SignInUserStep.cs | 10 +-
.../Umbraco.New.Cms.Web.Common.csproj | 2 +-
.../ContentCache.cs | 2 +-
.../ContentNodeKit.cs | 18 +-
.../DataSource/ContentData.cs | 97 +-
.../Umbraco.PublishedCache.NuCache.csproj | 4 +-
.../Controllers/AuthenticationController.cs | 35 +-
.../Controllers/BackOfficeController.cs | 14 +-
.../Controllers/BackOfficeServerVariables.cs | 6 +-
.../Controllers/CurrentUserController.cs | 73 +-
.../Controllers/EntityController.cs | 40 +
.../Controllers/HelpController.cs | 6 +
.../Controllers/LanguageController.cs | 22 +-
.../Controllers/LogViewerController.cs | 10 +
.../Controllers/MediaController.cs | 31 +
.../Controllers/MemberController.cs | 10 +-
.../Controllers/MemberTypeController.cs | 11 +
.../Controllers/TemplateController.cs | 25 +-
.../Controllers/TinyMceController.cs | 17 +-
.../Controllers/TwoFactorLoginController.cs | 20 +-
.../Controllers/UsersController.cs | 16 +-
.../UmbracoBuilder.LocalizedText.cs | 4 +-
...CreateUnattendedUserNotificationHandler.cs | 2 +-
.../Install/InstallApiController.cs | 61 +-
.../Install/InstallAreaRoutes.cs | 15 +-
.../Install/InstallAuthorizeAttribute.cs | 56 +-
.../Install/InstallController.cs | 56 +-
...igureGlobalOptionsForKeepAliveMiddlware.cs | 4 +-
.../BackOfficeAuthenticationBuilder.cs | 4 +-
.../Security/BackOfficeSessionIdValidator.cs | 7 +-
.../Security/BackOfficeSignInManager.cs | 6 +-
.../ConfigureBackOfficeCookieOptions.cs | 2 +-
.../Security/PasswordChanger.cs | 4 +-
.../Services/IconService.cs | 2 +-
.../MemberTypeAndGroupTreeControllerBase.cs | 15 +
.../Umbraco.Web.BackOffice.csproj | 4 +-
.../UmbracoApplicationBuilder.cs | 4 +-
.../AspNetCoreHostingEnvironment.cs | 2 +-
.../AspNetCore/AspNetCoreRequestAccessor.cs | 4 +-
.../AspNetCore/OptionsMonitorAdapter.cs | 2 +-
.../Extensions/FormCollectionExtensions.cs | 2 +-
.../FriendlyImageCropperTemplateExtensions.cs | 8 +
.../Extensions/HttpContextExtensions.cs | 4 +-
.../Media/MediaPrependBasePathFileProvider.cs | 94 -
.../Middleware/UmbracoRequestMiddleware.cs | 35 +
.../Routing/RoutableDocumentFilter.cs | 2 +-
.../SmidgeRuntimeMinifier.cs | 8 +
.../Security/BackOfficeUserManager.cs | 4 +-
.../Security/ConfigureIISServerOptions.cs | 22 +
.../Security/ConfigureMemberCookieOptions.cs | 2 +-
.../Security/ConfigureSecurityStampOptions.cs | 11 +-
.../Security/IBackOfficeSignInManager.cs | 4 +-
.../Security/IMemberSignInManager.cs | 4 +-
.../Security/MemberClaimsPrincipalFactory.cs | 5 +-
.../Security/MemberManager.cs | 6 +-
.../Security/MemberSignInManager.cs | 8 +-
.../Security/PublicAccessChecker.cs | 2 +-
.../Security/UmbracoSignInManager.cs | 10 +-
.../Umbraco.Web.Common.csproj | 14 +-
src/Umbraco.Web.UI.Client/package-lock.json | 3164 +++++++++--------
src/Umbraco.Web.UI.Client/package.json | 38 +-
.../src/common/services/tinymce.service.js | 33 +-
.../less/components/tree/umb-tree-root.less | 4 +-
.../src/less/components/umb-node-preview.less | 1 -
.../less/components/umb-readonlyvalue.less | 5 +-
.../src/less/installer.less | 45 +
.../src/less/mixins.less | 1 +
src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 25 +-
.../Controllers/UmbExternalLoginController.cs | 19 +-
.../Controllers/UmbLoginController.cs | 24 +-
.../Models/ProfileModelBuilder.cs | 2 +-
.../Security/MemberAuthenticationBuilder.cs | 4 +-
.../Umbraco.Web.Website.csproj | 2 +-
templates/Umbraco.Templates.csproj | 2 +-
.../UmbracoPackage/UmbracoPackage.csproj | 2 +-
.../UmbracoProject/UmbracoProject.csproj | 2 +-
templates/UmbracoProject/appsettings.json | 4 +-
.../Umbraco.TestData/Umbraco.TestData.csproj | 2 +-
.../misc/umbraco-linux.docker | 4 +-
.../Umbraco.Tests.Benchmarks.csproj | 6 +-
.../Testing/TestOptionAttributeBase.cs | 3 +
.../Umbraco.Tests.Common.csproj | 4 +-
.../Testing/UmbracoIntegrationTest.cs | 11 +-
.../Umbraco.Core/RuntimeStateTests.cs | 4 +-
.../Packaging/PackageDataInstallationTests.cs | 8 +-
.../Services/MacroServiceTests.cs | 7 +-
.../Services/RelationServiceTests.cs | 8 +-
.../Umbraco.Tests.Integration.csproj | 8 +-
.../Umbraco.Core/EnumExtensionsTests.cs | 19 +
.../Umbraco.Core/Models/CultureImpactTests.cs | 68 +-
.../DataValueEditorReuseTests.cs | 132 -
.../Umbraco.Core/Published/ModelTypeTests.cs | 2 +-
...faultShortStringHelperTestsWithoutSetup.cs | 6 +-
.../StringExtensionsTests.cs | 47 -
.../Security/MemberPasswordHasherTests.cs | 7 +-
.../Umbraco.Tests.UnitTests.csproj | 6 +-
version.json | 2 +-
296 files changed, 4106 insertions(+), 3401 deletions(-)
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Install/SettingsInstallController.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Install/SetupInstallController.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Install/ValidateDatabaseInstallController.cs
create mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/NewInstallController.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Server/StatusServerController.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Server/VersionServerController.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/AuthorizeUpgradeController.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs
rename src/Umbraco.Cms.ManagementApi/Controllers/{Upgrade/SettingsUpgradeController.cs => UpgradeController.cs} (58%)
delete mode 100644 src/Umbraco.Cms.ManagementApi/ViewModels/Pagination/PagedViewModel.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/ViewModels/Server/ServerStatusViewModel.cs
delete mode 100644 src/Umbraco.Cms.ManagementApi/ViewModels/Server/VersionViewModel.cs
create mode 100644 src/Umbraco.Core/Composing/IUserComposer.cs
create mode 100644 src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs
create mode 100644 src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs
create mode 100644 src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs
create mode 100644 src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs
create mode 100644 src/Umbraco.Core/Services/IExternalLoginService.cs
create mode 100644 src/Umbraco.Core/Services/IMacroWithAliasService.cs
delete mode 100644 src/Umbraco.Web.Common/Media/MediaPrependBasePathFileProvider.cs
create mode 100644 src/Umbraco.Web.Common/Security/ConfigureIISServerOptions.cs
delete mode 100644 tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueEditorReuseTests.cs
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index a3ffc10a1d..74e488206e 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -31,8 +31,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
- dotnet-version: '7.x'
- include-prerelease: true
+ dotnet-version: '6.0.x'
- name: dotnet build
run: dotnet build umbraco.sln -c SkipTests
diff --git a/Directory.Build.props b/Directory.Build.props
index 487c193812..8ae2e0baec 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -8,7 +8,7 @@
all
- 3.5.109
+ 3.5.107
diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml
index 606e0b6a67..ae8ca25f52 100644
--- a/build/azure-pipelines.yml
+++ b/build/azure-pipelines.yml
@@ -64,11 +64,6 @@ stages:
gulpFile: src/Umbraco.Web.UI.Client/gulpfile.js
targets: coreBuild
workingDirectory: src/Umbraco.Web.UI.Client
- - task: UseDotNet@2
- displayName: Use .NET 7.x
- inputs:
- version: 7.x
- includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Run dotnet build
inputs:
@@ -135,41 +130,41 @@ stages:
- task: PowerShell@2
displayName: Install DocFX
inputs:
- targetType: inline
- script: |
- choco install docfx --version=2.59.2 -y
- if ($lastexitcode -ne 0){
- throw ("Error installing DocFX")
- }
+ targetType: inline
+ script: |
+ choco install docfx --version=2.59.2 -y
+ if ($lastexitcode -ne 0){
+ throw ("Error installing DocFX")
+ }
- task: PowerShell@2
displayName: Generate metadata
inputs:
- targetType: inline
- script: |
- docfx metadata "$(Build.SourcesDirectory)/build/csharp-docs/docfx.json"
- if ($lastexitcode -ne 0){
- throw ("Error generating metadata.")
- }
+ targetType: inline
+ script: |
+ docfx metadata "$(Build.SourcesDirectory)/build/csharp-docs/docfx.json"
+ if ($lastexitcode -ne 0){
+ throw ("Error generating metadata.")
+ }
- task: PowerShell@2
displayName: Generate documentation
inputs:
- targetType: inline
- script: |
- docfx build "$(Build.SourcesDirectory)/build/csharp-docs/docfx.json"
- if ($lastexitcode -ne 0){
- throw ("Error generating documentation.")
- }
+ targetType: inline
+ script: |
+ docfx build "$(Build.SourcesDirectory)/build/csharp-docs/docfx.json"
+ if ($lastexitcode -ne 0){
+ throw ("Error generating documentation.")
+ }
- task: ArchiveFiles@2
displayName: Archive C# Docs
inputs:
- rootFolderOrFile: $(Build.SourcesDirectory)/build/csharp-docs/_site
- includeRootFolder: false
- archiveFile: $(Build.ArtifactStagingDirectory)/csharp-docs.zip
+ rootFolderOrFile: $(Build.SourcesDirectory)/build/csharp-docs/_site
+ includeRootFolder: false
+ archiveFile: $(Build.ArtifactStagingDirectory)/csharp-docs.zip
- task: PublishPipelineArtifact@1
displayName: Publish C# Docs
inputs:
- targetPath: $(Build.ArtifactStagingDirectory)/csharp-docs.zip
- artifact: csharp-docs
+ targetPath: $(Build.ArtifactStagingDirectory)/csharp-docs.zip
+ artifact: csharp-docs
# js API Reference
- job:
@@ -197,14 +192,14 @@ stages:
- task: ArchiveFiles@2
displayName: Archive js Docs
inputs:
- rootFolderOrFile: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Docs/api
- includeRootFolder: false
- archiveFile: $(Build.ArtifactStagingDirectory)/ui-docs.zip
+ rootFolderOrFile: $(Build.SourcesDirectory)/src/Umbraco.Web.UI.Docs/api
+ includeRootFolder: false
+ archiveFile: $(Build.ArtifactStagingDirectory)/ui-docs.zip
- task: PublishPipelineArtifact@1
displayName: Publish js Docs
inputs:
- targetPath: $(Build.ArtifactStagingDirectory)/ui-docs.zip
- artifact: ui-docs
+ targetPath: $(Build.ArtifactStagingDirectory)/ui-docs.zip
+ artifact: ui-docs
###############################################
## Test
@@ -233,10 +228,10 @@ stages:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
- displayName: Use net7
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) # net6 already on the other images
+ displayName: Use net6
inputs:
- version: 7.x
- includePreviewVersions: true
+ version: 6.x
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
@@ -269,10 +264,10 @@ stages:
artifact: build_output
path: $(Build.SourcesDirectory)
- task: UseDotNet@2
- displayName: Use net7
+ displayName: Use net6
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) # net6 already on the other images
inputs:
- version: 7.x
- includePreviewVersions: true
+ version: 6.x
- task: DotNetCoreCLI@2
displayName: Run dotnet test
inputs:
@@ -310,7 +305,7 @@ stages:
- powershell: sqllocaldb start mssqllocaldb
displayName: Start localdb (Windows only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- - powershell: docker run --name mssql -d -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD=$(SA_PASSWORD) -e MSSQL_PID=Developer mcr.microsoft.com/mssql/server:2019-latest
+ - powershell: docker run --name mssql -d -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD=$(SA_PASSWORD) -e MSSQL_PID=Developer mcr.microsoft.com/mssql/server:2019-latest
displayName: Start SQL Server (Linux only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- task: DotNetCoreCLI@2
@@ -332,7 +327,7 @@ stages:
displayName: E2E Tests
dependsOn: Build
jobs:
- # E2E Tests
+ # E2E Tests
- job:
displayName: E2E Tests
variables:
@@ -363,7 +358,7 @@ stages:
Windows:
vmImage: 'windows-latest'
pool:
- vmImage: $(vmImage)
+ vmImage: $(vmImage)
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nupkg
@@ -402,12 +397,7 @@ stages:
- powershell: Invoke-Sqlcmd -Query "CREATE DATABASE $env:UmbracoDatabaseName" -ServerInstance $env:UmbracoDatabaseServer
displayName: Create database (Windows only)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- - task: UseDotNet@2
- displayName: Use .Net 7.x
- inputs:
- version: 7.x
- includePreviewVersions: true
- # Linux containers smooth
+ # Linux containers smooth
- task: PowerShell@2
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
displayName: Build & run container (Linux only)
@@ -492,17 +482,14 @@ stages:
inputs:
artifact: nupkg
path: $(Build.ArtifactStagingDirectory)/nupkg
- - task: DotNetCoreCLI@2
- displayName: dotnet restore
+ - task: NuGetCommand@2
+ displayName: Nuget push
inputs:
- command: restore
- projects: '**/umbraco.sln'
- # TODO: Use NuGetCommand instead of DotNetCoreCLI
- # - task: NuGetCommand@2
- # displayName: Restore NuGet Packages
- # inputs:
- # restoreSolution: 'umbraco.sln'
- # feedsToUse: config
+ command: 'push'
+ packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
+ nuGetFeedType: 'external'
+ publishFeedCredentials: 'MyGet - Pre-releases'
+
- stage: Deploy_NuGet
displayName: NuGet release
dependsOn:
@@ -519,11 +506,13 @@ stages:
inputs:
artifact: nupkg
path: $(Build.ArtifactStagingDirectory)/nupkg
- - task: DotNetCoreCLI@2
- displayName: dotnet restore
+ - task: NuGetCommand@2
+ displayName: Nuget push
inputs:
- command: restore
- projects: '**/umbraco.sln'
+ command: 'push'
+ packagesToPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg
+ nuGetFeedType: 'external'
+ publishFeedCredentials: 'NuGet - Umbraco.*'
- stage: Upload_API_Docs
pool:
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 657774fcc0..ce54e08edd 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -7,7 +7,7 @@
10.0.0
10.0.0-rc1
10.0.0
- preview
+ 10.0
en-US
Umbraco CMS
Copyright © Umbraco 2021
@@ -44,11 +44,10 @@
-
-
-
-
-
-
-
+
+ true
+ 10.0.0
+ true
+ true
+
diff --git a/src/JsonSchema/JsonSchema.csproj b/src/JsonSchema/JsonSchema.csproj
index bd4f04071b..ea0ce9b7c3 100644
--- a/src/JsonSchema/JsonSchema.csproj
+++ b/src/JsonSchema/JsonSchema.csproj
@@ -1,7 +1,7 @@
Exe
- net7.0
+ net6.0
true
false
false
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs
deleted file mode 100644
index 275a5cd7b7..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using Microsoft.AspNetCore.Mvc;
-using NSwag.Annotations;
-using Umbraco.Cms.Core;
-using Umbraco.Cms.ManagementApi.Filters;
-using Umbraco.New.Cms.Web.Common.Routing;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Install;
-
-[ApiController]
-[BackOfficeRoute("api/v{version:apiVersion}/install")]
-[OpenApiTag("Install")]
-[RequireRuntimeLevel(RuntimeLevel.Install)]
-public abstract class InstallControllerBase : Controller
-{
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Install/SettingsInstallController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Install/SettingsInstallController.cs
deleted file mode 100644
index 53bae5ffaf..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Install/SettingsInstallController.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Umbraco.Cms.Core.Mapping;
-using Umbraco.Cms.Infrastructure.Install;
-using Umbraco.Cms.ManagementApi.ViewModels.Installer;
-using Umbraco.New.Cms.Core.Factories;
-using Umbraco.New.Cms.Core.Models.Installer;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Install;
-
-[ApiVersion("1.0")]
-public class SettingsInstallController : InstallControllerBase
-{
- private readonly InstallHelper _installHelper;
- private readonly IInstallSettingsFactory _installSettingsFactory;
- private readonly IUmbracoMapper _mapper;
-
- public SettingsInstallController(
- InstallHelper installHelper,
- IInstallSettingsFactory installSettingsFactory,
- IUmbracoMapper mapper)
- {
- _installHelper = installHelper;
- _installSettingsFactory = installSettingsFactory;
- _mapper = mapper;
- }
-
- [HttpGet("settings")]
- [MapToApiVersion("1.0")]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
- [ProducesResponseType(typeof(InstallSettingsViewModel), StatusCodes.Status200OK)]
- public async Task> Settings()
- {
- // Register that the install has started
- await _installHelper.SetInstallStatusAsync(false, string.Empty);
-
- InstallSettingsModel installSettings = _installSettingsFactory.GetInstallSettings();
- InstallSettingsViewModel viewModel = _mapper.Map(installSettings)!;
-
- return viewModel;
- }
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Install/SetupInstallController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Install/SetupInstallController.cs
deleted file mode 100644
index f639ad3d96..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Install/SetupInstallController.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Options;
-using Umbraco.Cms.Core.Configuration.Models;
-using Umbraco.Cms.Core.Hosting;
-using Umbraco.Cms.Core.Mapping;
-using Umbraco.Cms.ManagementApi.ViewModels.Installer;
-using Umbraco.Extensions;
-using Umbraco.New.Cms.Core.Models.Installer;
-using Umbraco.New.Cms.Core.Services.Installer;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Install;
-
-[ApiVersion("1.0")]
-public class SetupInstallController : InstallControllerBase
-{
- private readonly IUmbracoMapper _mapper;
- private readonly IInstallService _installService;
- private readonly IHostingEnvironment _hostingEnvironment;
- private readonly GlobalSettings _globalSettings;
-
- public SetupInstallController(
- IUmbracoMapper mapper,
- IInstallService installService,
- IOptions globalSettings,
- IHostingEnvironment hostingEnvironment)
- {
- _mapper = mapper;
- _installService = installService;
- _hostingEnvironment = hostingEnvironment;
- _globalSettings = globalSettings.Value;
- }
-
- [HttpPost("setup")]
- [MapToApiVersion("1.0")]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
- [ProducesResponseType(StatusCodes.Status200OK)]
- public async Task Setup(InstallViewModel installData)
- {
- InstallData data = _mapper.Map(installData)!;
- await _installService.Install(data);
-
- var backOfficePath = _globalSettings.GetBackOfficePath(_hostingEnvironment);
- return Created(backOfficePath, null);
- }
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Install/ValidateDatabaseInstallController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Install/ValidateDatabaseInstallController.cs
deleted file mode 100644
index ae5e26c2c1..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Install/ValidateDatabaseInstallController.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Umbraco.Cms.Core.Install.Models;
-using Umbraco.Cms.Core.Mapping;
-using Umbraco.Cms.Infrastructure.Migrations.Install;
-using Umbraco.Cms.ManagementApi.ViewModels.Installer;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Install;
-
-[ApiVersion("1.0")]
-public class ValidateDatabaseInstallController : InstallControllerBase
-{
- private readonly DatabaseBuilder _databaseBuilder;
- private readonly IUmbracoMapper _mapper;
-
- public ValidateDatabaseInstallController(
- DatabaseBuilder databaseBuilder,
- IUmbracoMapper mapper)
- {
- _databaseBuilder = databaseBuilder;
- _mapper = mapper;
- }
-
- [HttpPost("validateDatabase")]
- [MapToApiVersion("1.0")]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
- [ProducesResponseType(StatusCodes.Status200OK)]
- public async Task ValidateDatabase(DatabaseInstallViewModel viewModel)
- {
- // TODO: Async - We need to figure out what we want to do with async endpoints that doesn't do anything async
- // We want these to be async for future use (Ideally we'll have more async things),
- // But we need to figure out how we want to handle it in the meantime? use Task.FromResult or?
- DatabaseModel databaseModel = _mapper.Map(viewModel)!;
-
- var success = _databaseBuilder.ConfigureDatabaseConnection(databaseModel, true);
-
- if (success)
- {
- return Ok();
- }
-
- var invalidModelProblem = new ProblemDetails
- {
- Title = "Invalid database configuration",
- Detail = "The provided database configuration is invalid",
- Status = StatusCodes.Status400BadRequest,
- Type = "Error",
- };
-
- return BadRequest(invalidModelProblem);
- }
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/NewInstallController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/NewInstallController.cs
new file mode 100644
index 0000000000..94029edad4
--- /dev/null
+++ b/src/Umbraco.Cms.ManagementApi/Controllers/NewInstallController.cs
@@ -0,0 +1,111 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
+using Umbraco.Cms.Core;
+using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Hosting;
+using Umbraco.Cms.Core.Install.Models;
+using Umbraco.Cms.Core.Mapping;
+using Umbraco.Cms.Infrastructure.Install;
+using Umbraco.Cms.Infrastructure.Migrations.Install;
+using Umbraco.Cms.ManagementApi.Filters;
+using Umbraco.Cms.ManagementApi.ViewModels.Installer;
+using Umbraco.Extensions;
+using Umbraco.New.Cms.Core.Factories;
+using Umbraco.New.Cms.Core.Models.Installer;
+using Umbraco.New.Cms.Core.Services.Installer;
+using Umbraco.New.Cms.Web.Common.Routing;
+
+namespace Umbraco.Cms.ManagementApi.Controllers;
+
+[ApiController]
+[ApiVersion("1.0")]
+[BackOfficeRoute("api/v{version:apiVersion}/install")]
+[RequireRuntimeLevel(RuntimeLevel.Install)]
+public class NewInstallController : Controller
+{
+ private readonly IUmbracoMapper _mapper;
+ private readonly IInstallSettingsFactory _installSettingsFactory;
+ private readonly IInstallService _installService;
+ private readonly GlobalSettings _globalSettings;
+ private readonly IHostingEnvironment _hostingEnvironment;
+ private readonly InstallHelper _installHelper;
+ private readonly DatabaseBuilder _databaseBuilder;
+
+ public NewInstallController(
+ IUmbracoMapper mapper,
+ IInstallSettingsFactory installSettingsFactory,
+ IInstallService installService,
+ IOptions globalSettings,
+ IHostingEnvironment hostingEnvironment,
+ InstallHelper installHelper,
+ DatabaseBuilder databaseBuilder)
+ {
+ _mapper = mapper;
+ _installSettingsFactory = installSettingsFactory;
+ _installService = installService;
+ _globalSettings = globalSettings.Value;
+ _hostingEnvironment = hostingEnvironment;
+ _installHelper = installHelper;
+ _databaseBuilder = databaseBuilder;
+ }
+
+ [HttpGet("settings")]
+ [MapToApiVersion("1.0")]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
+ [ProducesResponseType(typeof(InstallSettingsViewModel), StatusCodes.Status200OK)]
+ public async Task> Settings()
+ {
+ // Register that the install has started
+ await _installHelper.SetInstallStatusAsync(false, string.Empty);
+
+ InstallSettingsModel installSettings = _installSettingsFactory.GetInstallSettings();
+ InstallSettingsViewModel viewModel = _mapper.Map(installSettings)!;
+
+ return viewModel;
+ }
+
+ [HttpPost("setup")]
+ [MapToApiVersion("1.0")]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public async Task Setup(InstallViewModel installData)
+ {
+ InstallData data = _mapper.Map(installData)!;
+ await _installService.Install(data);
+
+ var backOfficePath = _globalSettings.GetBackOfficePath(_hostingEnvironment);
+ return Created(backOfficePath, null);
+ }
+
+ [HttpPost("validateDatabase")]
+ [MapToApiVersion("1.0")]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public async Task ValidateDatabase(DatabaseInstallViewModel viewModel)
+ {
+ // TODO: Async - We need to figure out what we want to do with async endpoints that doesn't do anything async
+ // We want these to be async for future use (Ideally we'll have more async things),
+ // But we need to figure out how we want to handle it in the meantime? use Task.FromResult or?
+ DatabaseModel databaseModel = _mapper.Map(viewModel)!;
+
+ var success = _databaseBuilder.ConfigureDatabaseConnection(databaseModel, true);
+
+ if (success)
+ {
+ return Ok();
+ }
+
+ var invalidModelProblem = new ProblemDetails
+ {
+ Title = "Invalid database configuration",
+ Detail = "The provided database configuration is invalid",
+ Status = StatusCodes.Status400BadRequest,
+ Type = "Error",
+ };
+
+ return BadRequest(invalidModelProblem);
+ }
+}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs
deleted file mode 100644
index cdb4921ba3..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using Microsoft.AspNetCore.Mvc;
-using NSwag.Annotations;
-using Umbraco.New.Cms.Web.Common.Routing;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Server;
-
-[ApiController]
-[BackOfficeRoute("api/v{version:apiVersion}/server")]
-[OpenApiTag("Server")]
-public abstract class ServerControllerBase : Controller
-{
-
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Server/StatusServerController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Server/StatusServerController.cs
deleted file mode 100644
index 875e685c27..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Server/StatusServerController.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Umbraco.Cms.Core.Services;
-using Umbraco.Cms.ManagementApi.ViewModels.Server;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Server;
-
-[ApiVersion("1.0")]
-public class StatusServerController : ServerControllerBase
-{
- private readonly IRuntimeState _runtimeState;
-
- public StatusServerController(IRuntimeState runtimeState) => _runtimeState = runtimeState;
-
- [HttpGet("status")]
- [MapToApiVersion("1.0")]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
- [ProducesResponseType(typeof(ServerStatusViewModel), StatusCodes.Status200OK)]
- public async Task> Get() =>
- new ServerStatusViewModel { ServerStatus = _runtimeState.Level };
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Server/VersionServerController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Server/VersionServerController.cs
deleted file mode 100644
index fbd4f271e7..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Server/VersionServerController.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Umbraco.Cms.Core.Configuration;
-using Umbraco.Cms.ManagementApi.ViewModels.Server;
-using Umbraco.Extensions;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Server;
-
-[ApiVersion("1.0")]
-public class VersionServerController : ServerControllerBase
-{
- private readonly IUmbracoVersion _umbracoVersion;
-
- public VersionServerController(IUmbracoVersion umbracoVersion) => _umbracoVersion = umbracoVersion;
-
- [HttpGet("version")]
- [MapToApiVersion("1.0")]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
- [ProducesResponseType(typeof(VersionViewModel), StatusCodes.Status200OK)]
- public async Task> Get() =>
- new VersionViewModel { Version = _umbracoVersion.SemanticVersion.ToSemanticStringWithoutBuild() };
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/AuthorizeUpgradeController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/AuthorizeUpgradeController.cs
deleted file mode 100644
index 1c8740e0ad..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/AuthorizeUpgradeController.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Umbraco.New.Cms.Core.Services.Installer;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Upgrade;
-
-[ApiVersion("1.0")]
-public class AuthorizeUpgradeController : UpgradeControllerBase
-{
- private readonly IUpgradeService _upgradeService;
-
- public AuthorizeUpgradeController(IUpgradeService upgradeService) => _upgradeService = upgradeService;
-
- [HttpPost("authorize")]
- [MapToApiVersion("1.0")]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
- [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
- public async Task Authorize()
- {
- await _upgradeService.Upgrade();
- return Ok();
- }
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs
deleted file mode 100644
index 2b489501ec..0000000000
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Microsoft.AspNetCore.Mvc;
-using NSwag.Annotations;
-using Umbraco.Cms.Core;
-using Umbraco.Cms.ManagementApi.Filters;
-using Umbraco.New.Cms.Web.Common.Routing;
-
-namespace Umbraco.Cms.ManagementApi.Controllers.Upgrade;
-
-// TODO: This needs to be an authorized controller.
-
-[ApiController]
-[RequireRuntimeLevel(RuntimeLevel.Upgrade)]
-[BackOfficeRoute("api/v{version:apiVersion}/upgrade")]
-[OpenApiTag("Upgrade")]
-public abstract class UpgradeControllerBase : Controller
-{
-
-}
diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/SettingsUpgradeController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/UpgradeController.cs
similarity index 58%
rename from src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/SettingsUpgradeController.cs
rename to src/Umbraco.Cms.ManagementApi/Controllers/UpgradeController.cs
index a7a92cddc7..29164adfb2 100644
--- a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/SettingsUpgradeController.cs
+++ b/src/Umbraco.Cms.ManagementApi/Controllers/UpgradeController.cs
@@ -1,26 +1,48 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Mapping;
+using Umbraco.Cms.ManagementApi.Filters;
using Umbraco.Cms.ManagementApi.ViewModels.Installer;
using Umbraco.New.Cms.Core.Factories;
using Umbraco.New.Cms.Core.Models.Installer;
+using Umbraco.New.Cms.Core.Services.Installer;
+using Umbraco.New.Cms.Web.Common.Routing;
-namespace Umbraco.Cms.ManagementApi.Controllers.Upgrade;
+namespace Umbraco.Cms.ManagementApi.Controllers;
+// TODO: This needs to be an authorized controller.
+[ApiController]
[ApiVersion("1.0")]
-public class SettingsUpgradeController : UpgradeControllerBase
+[RequireRuntimeLevel(RuntimeLevel.Upgrade)]
+[BackOfficeRoute("api/v{version:apiVersion}/upgrade")]
+public class UpgradeController : Controller
{
private readonly IUpgradeSettingsFactory _upgradeSettingsFactory;
+ private readonly IUpgradeService _upgradeService;
private readonly IUmbracoMapper _mapper;
- public SettingsUpgradeController(
+ public UpgradeController(
IUpgradeSettingsFactory upgradeSettingsFactory,
+ IUpgradeService upgradeService,
IUmbracoMapper mapper)
{
_upgradeSettingsFactory = upgradeSettingsFactory;
+ _upgradeService = upgradeService;
_mapper = mapper;
}
+ [HttpPost("authorize")]
+ [MapToApiVersion("1.0")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)]
+ [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
+ public async Task Authorize()
+ {
+ await _upgradeService.Upgrade();
+ return Ok();
+ }
+
[HttpGet("settings")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(UpgradeSettingsViewModel), StatusCodes.Status200OK)]
diff --git a/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs b/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs
index 1f57d99e4a..f0921f2244 100644
--- a/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs
+++ b/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs
@@ -62,10 +62,9 @@ public class ManagementApiComposer : IComposer
// Not super happy with this, but we need to know the UmbracoPath when registering the controller
// To be able to replace the route template token
- // TODO this is fixed in Bjarkes PR for v10, and will need to be removed in v11 merge
GlobalSettings? globalSettings =
builder.Config.GetSection(Constants.Configuration.ConfigGlobal).Get();
- var backofficePath = (globalSettings?.UmbracoPath ?? new GlobalSettings().UmbracoPath).TrimStart(Constants.CharArrays.TildeForwardSlash);
+ var backofficePath = globalSettings.UmbracoPath.TrimStart(Constants.CharArrays.TildeForwardSlash);
services.AddControllers(options =>
{
diff --git a/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj b/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
index b2ed549a52..fb8c327221 100644
--- a/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
+++ b/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
enable
enable
nullable
diff --git a/src/Umbraco.Cms.ManagementApi/ViewModels/Pagination/PagedViewModel.cs b/src/Umbraco.Cms.ManagementApi/ViewModels/Pagination/PagedViewModel.cs
deleted file mode 100644
index 7d9760bda4..0000000000
--- a/src/Umbraco.Cms.ManagementApi/ViewModels/Pagination/PagedViewModel.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Umbraco.Cms.ManagementApi.ViewModels.Pagination;
-
-public class PagedViewModel
-{
- public long Total { get; set; }
-
- public IEnumerable Items { get; set; } = Enumerable.Empty();
-}
diff --git a/src/Umbraco.Cms.ManagementApi/ViewModels/Server/ServerStatusViewModel.cs b/src/Umbraco.Cms.ManagementApi/ViewModels/Server/ServerStatusViewModel.cs
deleted file mode 100644
index 48cfed65c4..0000000000
--- a/src/Umbraco.Cms.ManagementApi/ViewModels/Server/ServerStatusViewModel.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Text.Json.Serialization;
-using Umbraco.Cms.Core;
-
-namespace Umbraco.Cms.ManagementApi.ViewModels.Server;
-
-public class ServerStatusViewModel
-{
- [JsonConverter(typeof(JsonStringEnumConverter))]
- public RuntimeLevel ServerStatus { get; set; }
-}
diff --git a/src/Umbraco.Cms.ManagementApi/ViewModels/Server/VersionViewModel.cs b/src/Umbraco.Cms.ManagementApi/ViewModels/Server/VersionViewModel.cs
deleted file mode 100644
index 41a55e64b7..0000000000
--- a/src/Umbraco.Cms.ManagementApi/ViewModels/Server/VersionViewModel.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Umbraco.Cms.ManagementApi.ViewModels.Server;
-
-public class VersionViewModel
-{
- public string Version { get; set; } = null!;
-}
diff --git a/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj b/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj
index e78c210ae2..e206cd8653 100644
--- a/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj
+++ b/src/Umbraco.Cms.Persistence.SqlServer/Umbraco.Cms.Persistence.SqlServer.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
Umbraco.Cms.Persistence.SqlServer
Umbraco.Cms.Persistence.SqlServer
Adds support for SQL Server to Umbraco CMS.
diff --git a/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj b/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj
index 943757b353..5aa062df17 100644
--- a/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj
+++ b/src/Umbraco.Cms.Persistence.Sqlite/Umbraco.Cms.Persistence.Sqlite.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
Umbraco.Cms.Persistence.Sqlite
Umbraco.Cms.Persistence.Sqlite
Adds support for SQLite to Umbraco CMS.
@@ -12,7 +12,6 @@
-
diff --git a/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj b/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj
index 89cb8a44aa..1fbbd8c42f 100644
--- a/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj
+++ b/src/Umbraco.Cms.StaticAssets/Umbraco.Cms.StaticAssets.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
true
Umbraco.Cms.StaticAssets
Contains the static assets that is required to run Umbraco CMS.
diff --git a/src/Umbraco.Cms/Umbraco.Cms.csproj b/src/Umbraco.Cms/Umbraco.Cms.csproj
index ce43dc67fc..c6c63108ff 100644
--- a/src/Umbraco.Cms/Umbraco.Cms.csproj
+++ b/src/Umbraco.Cms/Umbraco.Cms.csproj
@@ -1,6 +1,6 @@
- net7.0
+ net6.0
false
Umbraco.Cms
Umbraco.Cms
diff --git a/src/Umbraco.Core/Composing/IUserComposer.cs b/src/Umbraco.Core/Composing/IUserComposer.cs
new file mode 100644
index 0000000000..a3e45054f8
--- /dev/null
+++ b/src/Umbraco.Core/Composing/IUserComposer.cs
@@ -0,0 +1,9 @@
+namespace Umbraco.Cms.Core.Composing;
+
+///
+/// Represents a user .
+///
+[Obsolete("This interface is obsolete. Use IComposer instead.")]
+public interface IUserComposer : IComposer
+{
+}
diff --git a/src/Umbraco.Core/Configuration/ConfigureConnectionStrings.cs b/src/Umbraco.Core/Configuration/ConfigureConnectionStrings.cs
index 69ef69239e..cd256e1b45 100644
--- a/src/Umbraco.Core/Configuration/ConfigureConnectionStrings.cs
+++ b/src/Umbraco.Core/Configuration/ConfigureConnectionStrings.cs
@@ -23,13 +23,8 @@ public class ConfigureConnectionStrings : IConfigureNamedOptions Configure(Options.DefaultName, options);
///
- public void Configure(string? name, ConnectionStrings options)
+ public void Configure(string name, ConnectionStrings options)
{
- if (name is null)
- {
- throw new InvalidOperationException("The name of the option instance is required.");
- }
-
// Default to using UmbracoConnectionName
if (name == Options.DefaultName)
{
diff --git a/src/Umbraco.Core/Configuration/Models/ContentSettings.cs b/src/Umbraco.Core/Configuration/Models/ContentSettings.cs
index f4f3040b79..f0532a7203 100644
--- a/src/Umbraco.Core/Configuration/Models/ContentSettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/ContentSettings.cs
@@ -157,7 +157,6 @@ public class ContentSettings
internal const bool StaticHideBackOfficeLogo = false;
internal const bool StaticDisableDeleteWhenReferenced = false;
internal const bool StaticDisableUnpublishWhenReferenced = false;
- internal const bool StaticAllowEditInvariantFromNonDefault = false;
///
/// Gets or sets a value for the content notification settings.
@@ -243,10 +242,4 @@ public class ContentSettings
/// Get or sets the model representing the global content version cleanup policy
///
public ContentVersionCleanupPolicySettings ContentVersionCleanupPolicy { get; set; } = new();
-
- ///
- /// Gets or sets a value indicating whether to allow editing invariant properties from a non-default language variation.
- ///
- [DefaultValue(StaticAllowEditInvariantFromNonDefault)]
- public bool AllowEditInvariantFromNonDefault { get; set; } = StaticAllowEditInvariantFromNonDefault;
}
diff --git a/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs b/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs
index 672577b1b7..0c5d39f47a 100644
--- a/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs
@@ -19,36 +19,30 @@ public class RequestHandlerSettings
internal static readonly CharItem[] DefaultCharCollection =
{
- new() { Char = " ", Replacement = "-" },
- new() { Char = "\"", Replacement = string.Empty },
- new() { Char = "'", Replacement = string.Empty },
- new() { Char = "%", Replacement = string.Empty },
- new() { Char = ".", Replacement = string.Empty },
- new() { Char = ";", Replacement = string.Empty },
- new() { Char = "/", Replacement = string.Empty },
- new() { Char = "\\", Replacement = string.Empty },
- new() { Char = ":", Replacement = string.Empty },
- new() { Char = "#", Replacement = string.Empty },
- new() { Char = "&", Replacement = string.Empty },
- new() { Char = "?", Replacement = string.Empty },
- new() { Char = "<", Replacement = string.Empty },
- new() { Char = ">", Replacement = string.Empty },
- new() { Char = "+", Replacement = "plus" },
- new() { Char = "*", Replacement = "star" },
- new() { Char = "æ", Replacement = "ae" },
- new() { Char = "Æ", Replacement = "ae" },
- new() { Char = "ä", Replacement = "ae" },
- new() { Char = "Ä", Replacement = "ae" },
- new() { Char = "ø", Replacement = "oe" },
- new() { Char = "Ø", Replacement = "oe" },
- new() { Char = "ö", Replacement = "oe" },
- new() { Char = "Ö", Replacement = "oe" },
- new() { Char = "å", Replacement = "aa" },
- new() { Char = "Å", Replacement = "aa" },
- new() { Char = "ü", Replacement = "ue" },
- new() { Char = "Ü", Replacement = "ue" },
- new() { Char = "ß", Replacement = "ss" },
- new() { Char = "|", Replacement = "-" },
+ new () { Char = " ", Replacement = "-" },
+ new () { Char = "\"", Replacement = string.Empty },
+ new () { Char = "'", Replacement = string.Empty },
+ new () { Char = "%", Replacement = string.Empty },
+ new () { Char = ".", Replacement = string.Empty },
+ new () { Char = ";", Replacement = string.Empty },
+ new () { Char = "/", Replacement = string.Empty },
+ new () { Char = "\\", Replacement = string.Empty },
+ new () { Char = ":", Replacement = string.Empty },
+ new () { Char = "#", Replacement = string.Empty },
+ new () { Char = "+", Replacement = "plus" },
+ new () { Char = "*", Replacement = "star" },
+ new () { Char = "&", Replacement = string.Empty },
+ new () { Char = "?", Replacement = string.Empty },
+ new () { Char = "æ", Replacement = "ae" },
+ new () { Char = "ä", Replacement = "ae" },
+ new () { Char = "ø", Replacement = "oe" },
+ new () { Char = "ö", Replacement = "oe" },
+ new () { Char = "å", Replacement = "aa" },
+ new () { Char = "ü", Replacement = "ue" },
+ new () { Char = "ß", Replacement = "ss" },
+ new () { Char = "|", Replacement = "-" },
+ new () { Char = "<", Replacement = string.Empty },
+ new () { Char = ">", Replacement = string.Empty },
};
///
@@ -79,6 +73,13 @@ public class RequestHandlerSettings
[DefaultValue(StaticEnableDefaultCharReplacements)]
public bool EnableDefaultCharReplacements { get; set; } = StaticEnableDefaultCharReplacements;
+ ///
+ /// Add additional character replacements, or override defaults
+ ///
+ [Obsolete(
+ "Use the GetCharReplacements extension method in the Umbraco.Extensions namespace instead. Scheduled for removal in V11")]
+ public IEnumerable CharCollection { get; set; } = DefaultCharCollection;
+
///
/// Add additional character replacements, or override defaults
///
diff --git a/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs b/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
index 708f9b98c2..586b3955c2 100644
--- a/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/SecuritySettings.cs
@@ -86,10 +86,9 @@ public class SecuritySettings
[DefaultValue(StaticUserBypassTwoFactorForExternalLogins)]
public bool UserBypassTwoFactorForExternalLogins { get; set; } = StaticUserBypassTwoFactorForExternalLogins;
- ///
- /// Gets or sets a value indicating whether to allow editing invariant properties from a non-default language variation.
- ///
- [Obsolete("Use ContentSettings.AllowEditFromInvariant instead")]
- [DefaultValue(StaticAllowEditInvariantFromNonDefault)]
- public bool AllowEditInvariantFromNonDefault { get; set; } = StaticAllowEditInvariantFromNonDefault;
+ ///
+ /// Gets or sets a value indicating whether to allow editing invariant properties from a non-default language variation.
+ ///
+ [DefaultValue(StaticAllowEditInvariantFromNonDefault)]
+ public bool AllowEditInvariantFromNonDefault { get; set; } = StaticAllowEditInvariantFromNonDefault;
}
diff --git a/src/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidator.cs b/src/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidator.cs
index 5062dc87e4..0798014600 100644
--- a/src/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidator.cs
+++ b/src/Umbraco.Core/Configuration/Models/Validation/ContentSettingsValidator.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Core.Configuration.Models.Validation;
public class ContentSettingsValidator : ConfigurationValidatorBase, IValidateOptions
{
///
- public ValidateOptionsResult Validate(string? name, ContentSettings options)
+ public ValidateOptionsResult Validate(string name, ContentSettings options)
{
if (!ValidateError404Collection(options.Error404Collection, out var message))
{
diff --git a/src/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidator.cs b/src/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidator.cs
index f78ce306dd..32ad130c33 100644
--- a/src/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidator.cs
+++ b/src/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidator.cs
@@ -12,7 +12,7 @@ public class GlobalSettingsValidator
: ConfigurationValidatorBase, IValidateOptions
{
///
- public ValidateOptionsResult Validate(string? name, GlobalSettings options)
+ public ValidateOptionsResult Validate(string name, GlobalSettings options)
{
if (!ValidateSmtpSetting(options.Smtp, out var message))
{
diff --git a/src/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidator.cs b/src/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidator.cs
index 2b55afdcb0..ac0e1651ea 100644
--- a/src/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidator.cs
+++ b/src/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidator.cs
@@ -19,7 +19,7 @@ public class HealthChecksSettingsValidator : ConfigurationValidatorBase, IValida
public HealthChecksSettingsValidator(ICronTabParser cronTabParser) => _cronTabParser = cronTabParser;
///
- public ValidateOptionsResult Validate(string? name, HealthChecksSettings options)
+ public ValidateOptionsResult Validate(string name, HealthChecksSettings options)
{
if (!ValidateNotificationFirstRunTime(options.Notification.FirstRunTime, out var message))
{
diff --git a/src/Umbraco.Core/Configuration/Models/Validation/RequestHandlerSettingsValidator.cs b/src/Umbraco.Core/Configuration/Models/Validation/RequestHandlerSettingsValidator.cs
index 8515fc3cc4..4a1872cf30 100644
--- a/src/Umbraco.Core/Configuration/Models/Validation/RequestHandlerSettingsValidator.cs
+++ b/src/Umbraco.Core/Configuration/Models/Validation/RequestHandlerSettingsValidator.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Core.Configuration.Models.Validation;
public class RequestHandlerSettingsValidator : ConfigurationValidatorBase, IValidateOptions
{
///
- public ValidateOptionsResult Validate(string? name, RequestHandlerSettings options)
+ public ValidateOptionsResult Validate(string name, RequestHandlerSettings options)
{
if (!ValidateConvertUrlsToAscii(options.ConvertUrlsToAscii, out var message))
{
diff --git a/src/Umbraco.Core/Configuration/Models/Validation/UnattendedSettingsValidator.cs b/src/Umbraco.Core/Configuration/Models/Validation/UnattendedSettingsValidator.cs
index 473224553a..e262de76e7 100644
--- a/src/Umbraco.Core/Configuration/Models/Validation/UnattendedSettingsValidator.cs
+++ b/src/Umbraco.Core/Configuration/Models/Validation/UnattendedSettingsValidator.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Umbraco.
+// Copyright (c) Umbraco.
// See LICENSE for more details.
using Microsoft.Extensions.Options;
@@ -12,7 +12,7 @@ public class UnattendedSettingsValidator
: IValidateOptions
{
///
- public ValidateOptionsResult Validate(string? name, UnattendedSettings options)
+ public ValidateOptionsResult Validate(string name, UnattendedSettings options)
{
if (options.InstallUnattended)
{
diff --git a/src/Umbraco.Core/Constants-Conventions.cs b/src/Umbraco.Core/Constants-Conventions.cs
index 22acf8cc4d..7b221e1435 100644
--- a/src/Umbraco.Core/Constants-Conventions.cs
+++ b/src/Umbraco.Core/Constants-Conventions.cs
@@ -178,6 +178,68 @@ public static partial class Constants
public const string CommentsLabel = "Comments";
+ ///
+ /// Property alias for the Approved boolean of a Member
+ ///
+ [Obsolete(
+ "IsApproved is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")]
+ public const string IsApproved = "umbracoMemberApproved";
+
+ [Obsolete("Use the stateApproved translation in the user area instead, scheduled for removal in V11")]
+ public const string IsApprovedLabel = "Is Approved";
+
+ ///
+ /// Property alias for the Locked out boolean of a Member
+ ///
+ [Obsolete(
+ "IsLockedOut is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")]
+ public const string IsLockedOut = "umbracoMemberLockedOut";
+
+ [Obsolete("Use the stateLockedOut translation in the user area instead, scheduled for removal in V11")]
+ public const string IsLockedOutLabel = "Is Locked Out";
+
+ ///
+ /// Property alias for the last date the Member logged in
+ ///
+ [Obsolete(
+ "LastLoginDate is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")]
+ public const string LastLoginDate = "umbracoMemberLastLogin";
+
+ [Obsolete("Use the lastLogin translation in the user area instead, scheduled for removal in V11")]
+ public const string LastLoginDateLabel = "Last Login Date";
+
+ ///
+ /// Property alias for the last date a Member changed its password
+ ///
+ [Obsolete(
+ "LastPasswordChangeDate is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")]
+ public const string LastPasswordChangeDate = "umbracoMemberLastPasswordChangeDate";
+
+ [Obsolete(
+ "Use the lastPasswordChangeDate translation in the user area instead, scheduled for removal in V11")]
+ public const string LastPasswordChangeDateLabel = "Last Password Change Date";
+
+ ///
+ /// Property alias for the last date a Member was locked out
+ ///
+ [Obsolete(
+ "LastLockoutDate is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")]
+ public const string LastLockoutDate = "umbracoMemberLastLockoutDate";
+
+ [Obsolete("Use the lastLockoutDate translation in the user area instead, scheduled for removal in V11")]
+ public const string LastLockoutDateLabel = "Last Lockout Date";
+
+ ///
+ /// Property alias for the number of failed login attempts
+ ///
+ [Obsolete(
+ "FailedPasswordAttempts is no longer property data, access the property directly on IMember instead, scheduled for removal in V11")]
+ public const string FailedPasswordAttempts = "umbracoMemberFailedPasswordAttempts";
+
+ [Obsolete(
+ "Use the failedPasswordAttempts translation in the user area instead, scheduled for removal in V11")]
+ public const string FailedPasswordAttemptsLabel = "Failed Password Attempts";
+
///
/// The standard properties group alias for membership properties.
///
diff --git a/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs b/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs
index 579a34894a..ec26080e76 100644
--- a/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs
+++ b/src/Umbraco.Core/DependencyInjection/ServiceCollectionExtensions.cs
@@ -68,7 +68,16 @@ public static class ServiceCollectionExtensions
services.AddUnique(factory => (TImplementing)factory.GetRequiredService(), lifetime);
}
- ///
+ // TODO(V11): Remove this function.
+ [Obsolete("This method is functionally equivalent to AddSingleton() please use that instead.")]
+ public static void AddUnique(this IServiceCollection services)
+ where TImplementing : class
+ {
+ services.RemoveAll();
+ services.AddSingleton();
+ }
+
+ ///
/// Adds a service of type with an implementation factory method to the specified
/// .
///
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs
index fc78d985f7..c409a849ec 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.CollectionBuilders.cs
@@ -84,8 +84,12 @@ public static partial class UmbracoBuilderExtensions
return builder;
}
+ [Obsolete("Use AddEmbedProvider instead. This will be removed in Umbraco 11")]
+ public static IUmbracoBuilder AddOEmbedProvider(this IUmbracoBuilder builder)
+ where T : class, IEmbedProvider => AddEmbedProvider(builder);
+
///
- /// Register a section.
+ /// Register a section.
///
/// The type of the section.
/// The builder.
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
index 280d7ce492..c699e09743 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
@@ -272,6 +272,14 @@ public static partial class UmbracoBuilderExtensions
public static MediaUrlGeneratorCollectionBuilder MediaUrlGenerators(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder();
+ ///
+ /// Gets the backoffice OEmbed Providers collection builder.
+ ///
+ /// The builder.
+ [Obsolete("Use EmbedProviders() instead")]
+ public static EmbedProvidersCollectionBuilder OEmbedProviders(this IUmbracoBuilder builder)
+ => EmbedProviders(builder);
+
///
/// Gets the backoffice Embed Providers collection builder.
///
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
index 31ef06c400..90e2e49c94 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration;
@@ -103,19 +102,7 @@ public static partial class UmbracoBuilderExtensions
Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes,
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes}"));
- // TODO: Remove this in V12
- // This is to make the move of the AllowEditInvariantFromNonDefault setting from SecuritySettings to ContentSettings backwards compatible
- // If there is a value in security settings, but no value in content setting we'll use that value, otherwise content settings always wins.
- builder.Services.Configure(settings =>
- {
- var securitySettingsValue = builder.Config.GetSection($"{Constants.Configuration.ConfigSecurity}").GetValue(nameof(SecuritySettings.AllowEditInvariantFromNonDefault));
- var contentSettingsValue = builder.Config.GetSection($"{Constants.Configuration.ConfigContent}").GetValue(nameof(ContentSettings.AllowEditInvariantFromNonDefault));
-
- if (securitySettingsValue is not null && contentSettingsValue is null)
- {
- settings.AllowEditInvariantFromNonDefault = securitySettingsValue.Value;
- }
- });
+ builder.Services.Configure(options => options.MergeReplacements(builder.Config));
return builder;
}
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
index d806950584..ff2d4a1f1e 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
@@ -307,6 +307,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
factory.GetRequiredService(),
factory.GetRequiredService()
));
+ Services.AddUnique(factory => factory.GetRequiredService());
Services.AddUnique(factory => factory.GetRequiredService());
Services.AddUnique(factory => new LocalizedTextService(
factory.GetRequiredService>(),
@@ -323,7 +324,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
Services.AddUnique();
Services.AddUnique();
- Services.AddUnique(provider => new CultureImpactFactory(provider.GetRequiredService>()));
+ Services.AddUnique();
}
}
}
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml b/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml
index 29b242d67e..939b515eeb 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/cs.xml
@@ -781,8 +781,8 @@
Stiskněte Následující pro pokračování. ]]>
následující, pro pokračování konfiguračního průvodce]]>
Heslo výchozího uživatele musí být změněno!]]>
- Výchozí uživatel byl deaktivován, nebo nemá přístup k umbracu!
Netřeba nic dalšího dělat. Klikněte na Následující pro pokračování.]]>
- Heslo výchozího uživatele bylo úspěšně změněno od doby instalace!
Netřeba nic dalšího dělat. Klikněte na Následující pro pokračování.]]>
+ Výchozí uživatel byl deaktivován, nebo nemá přístup k umbracu!
Netřeba nic dalšího dělat. Klikněte na Následující pro pokračování.]]>
+ Heslo výchozího uživatele bylo úspěšně změněno od doby instalace!
Netřeba nic dalšího dělat. Klikněte na Následující pro pokračování.]]>
Heslo je změněno!
Mějte skvělý start, sledujte naše uváděcí videa
Není nainstalováno.
@@ -797,7 +797,7 @@
Vaše nastavení oprávnění může být problém!
Můžete provozovat Umbraco bez potíží, ale nebudete smět vytvářet složky a instalovat balíčky, které jsou doporučené pro plné využívání všech možností umbraca.]]>
- Vaše nastavení oprívnění není připraveno pro Umbraco!
+ Vaše nastavení oprívnění není připraveno pro umbraco!
Abyste mohli Umbraco provozovat, budete muset aktualizovat Vaše nastavení oprávnění.]]>
Vaše nastavení oprávnění je dokonalé!
@@ -838,7 +838,7 @@
Krok 3/5: Ověřování oprávnění k souborům
Krok 4/5: Kontrola zabezpečení umbraca
Krok 5/5: Umbraco je připraveno a můžete začít
- Děkujeme, že jeste si vybrali Umbraco
+ Děkujeme, že jeste si vybrali umbraco
Prohlédněte si svůj nový web
Nainstalovali jste Runway, tak proč se nepodívat, jak Váš nový web vypadá.]]>
Další pomoc a informace
@@ -1379,7 +1379,7 @@
Makro je konfigurovatelná součást, která je skvělá pro opakovaně použitelné části návrhu, kde potřebujete předat parametry, jako jsou galerie, formuláře a seznamy.
- Vložit pole stránky Umbraco
+ Vložit pole stránky umbraco
Zobrazuje hodnotu pojmenovaného pole z aktuální stránky s možnostmi upravit hodnotu nebo alternativní hodnoty.
Částečná šablona
@@ -2132,7 +2132,7 @@
Profilování výkonu
Umbraco aktuálně běží v režimu ladění. To znamená, že můžete použít vestavěný profiler výkonu k vyhodnocení výkonu při vykreslování stránek.
Pokud chcete aktivovat profiler pro konkrétní vykreslení stránky, jednoduše při požadavku na stránku jednoduše přidejte umbDebug=true do URL.
Pokud chcete, aby byl profiler ve výchozím nastavení aktivován pro všechna vykreslení stránky, můžete použít přepínač níže. Ve vašem prohlížeči nastaví soubor cookie, který automaticky aktivuje profiler. Jinými slovy, profiler bude ve výchozím nastavení aktivní pouze ve vašem prohlížeči, ne v ostatních.
+ Umbraco aktuálně běží v režimu ladění. To znamená, že můžete použít vestavěný profiler výkonu k vyhodnocení výkonu při vykreslování stránek.
Pokud chcete aktivovat profiler pro konkrétní vykreslení stránky, jednoduše při požadavku na stránku jednoduše přidejte umbDebug=true do URL.
Pokud chcete, aby byl profiler ve výchozím nastavení aktivován pro všechna vykreslení stránky, můžete použít přepínač níže. Ve vašem prohlížeči nastaví soubor cookie, který automaticky aktivuje profiler. Jinými slovy, profiler bude ve výchozím nastavení aktivní pouze ve vašem prohlížeči, ne v ostatních.
]]>
Ve výchozím stavu aktivovat profiler
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml b/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml
index e34cc2ab29..d0c6a45d27 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/cy.xml
@@ -449,13 +449,13 @@
Gweinyddu enwau gwesteia
Cau'r ffenestr yma
Ydych chi'n sicr eich bod eisiau dileu
- %0% yn seiliedig ar %1% ]]>
+ %0% yn seiliedig ar %1% ]]>
Ydych chi'n sicr eich bod eisiau analluogi
Wyt ti'n siŵr fod ti eisiau dileu
- %0%]]>
- %0%]]>
+ %0%]]>
+ %0%]]>
Ydych chi'n sicr?
Ydych chi'n sicr?
@@ -546,8 +546,8 @@
Dewiswch ffurfweddiad
Dewiswch damaid
Bydd hyn yn dileu'r nod a'i holl ieithoedd. Os mai dim ond un iaith yr ydych am ei dileu, ewch i'w anghyhoedd yn lle.
- %0%.]]>
- %0% o'r grŵp %1% ]]>
+ %0%.]]>
+ %0% o'r grŵp %1% ]]>
Ydw, dileu
@@ -965,7 +965,7 @@
nesaf i barhau gyda'r dewin ffurfwedd]]>
Mae angen newid cyfrinair y defnyddiwr Diofyn!]]>
- Mae'r defnyddiwr Diofyn wedi'u analluogi neu does dim hawliau i Umbraco!Does dim angen unrhyw weithredoedd pellach. Cliciwch Nesaf i barhau.]]>
+ Mae'r defnyddiwr Diofyn wedi'u analluogi neu does dim hawliau i Umbraco!Does dim angen unrhyw weithredoedd pellach. Cliciwch Nesaf i barhau.]]>
Mae cyfrinair y defnyddiwr Diofyn wedi'i newid yn llwyddiannus ers y gosodiad!Does dim angen unrhyw weithredoedd pellach. Cliciwch Nesaf i barhau.]]>
Mae'r cyfrinair wedi'i newid!
Cewch gychwyn gwych, gwyliwch ein fideos rhaglith
@@ -2695,12 +2695,12 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang
Mae Umbraco yn rhedeg mewn modd dadfygio. Mae hyn yn golygu y gallwch chi ddefnyddio'r proffiliwr perfformiad adeiledig i asesu'r perfformiad wrth rendro tudalennau.
- OS ti eisiau actifadu'r proffiliwr am rendro tudalen penodol, bydd angen ychwanegu umbDebug=true i'r ymholiad wrth geisio am y tudalen
+ OS ti eisiau actifadu'r proffiliwr am rendro tudalen penodol, bydd angen ychwanegu umbDebug=true i'r ymholiad wrth geisio am y tudalen
Os ydych chi am i'r proffiliwr gael ei actifadu yn ddiofyn am bob rendrad tudalen, gallwch chi ddefnyddio'r togl isod.
Bydd e'n gosod cwci yn eich porwr, sydd wedyn yn actifadu'r proffiliwr yn awtomatig.
- Mewn geiriau eraill, bydd y proffiliwr dim ond yn actif yn ddiofyn yn eich porwr chi - nid porwr pawb eraill.
+ Mewn geiriau eraill, bydd y proffiliwr dim ond yn actif yn ddiofyn yn eich porwr chi - nid porwr pawb eraill.
]]>
@@ -2709,7 +2709,7 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang
- Ni ddylech chi fyth adael i safle cynhyrchu redeg yn y modd dadfygio. Mae'r modd dadfygio yn gallu cael ei diffodd trwy ychwanegu'r gosodiad debug="false" ar yr elfen <grynhoi /> yn web.config.
+ Ni ddylech chi fyth adael i safle cynhyrchu redeg yn y modd dadfygio. Mae'r modd dadfygio yn gallu cael ei diffodd trwy ychwanegu'r gosodiad debug="false" ar yr elfen <grynhoi /> yn web.config.
]]>
@@ -2719,7 +2719,7 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang
Mae Umbraco ddim yn rhedeg mewn modd dadfygio ar hyn o bryd, felly nid allwch chi ddefnyddio'r proffiliwer adeiledig. Dyma sut y dylai fod ar gyfer safle cynhyrchu.
- Mae'r modd dadfygio yn gallu cael ei throi arno gan ychwanegu'r gosodiad debug="true" ar yr elfen <grynhoi /> yn web.config.
+ Mae'r modd dadfygio yn gallu cael ei throi arno gan ychwanegu'r gosodiad debug="true" ar yr elfen <grynhoi /> yn web.config.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml
index 93b0f95af2..b03fa9d884 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml
@@ -465,7 +465,7 @@
Er du sikker på at du vil slette
Er du sikker på du vil deaktivere
Er du sikker på at du vil fjerne
- %0%]]>
+ %0%]]>
Er du sikker på at du vil forlade Umbraco?
Er du sikker?
Klip
@@ -556,8 +556,8 @@
Dette vil slette noden og alle dets sprog. Hvis du kun vil slette et sprog, så
afpublicér det i stedet.
- %0%]]>
- %0% fra %1% gruppen]]>
+ %0%]]>
+ %0% fra gruppen]]>
Ja, fjern
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
index 0a8b03b115..e6ba39eb17 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml
@@ -469,10 +469,10 @@
Manage hostnames
Close this window
Are you sure you want to delete
- %0% of %1% items]]>
+ %0% of %1% items]]>
Are you sure you want to disable
Are you sure you want to remove
- %0%]]>
+ %0%]]>
Are you sure?
Are you sure?
Cut
@@ -564,8 +564,8 @@
This will delete the node and all its languages. If you only want to delete one
language, you should unpublish the node in that language instead.
- %0%.]]>
- %0% from the %1% group]]>
+ %0%.]]>
+ %0% from the %1% group]]>
Yes, remove
You are deleting the layout
Modifying layout will result in loss of data for any existing content that is based on this configuration.
@@ -948,7 +948,7 @@
The Default users' password needs to be changed!]]>
- The Default user has been disabled or has no access to Umbraco!No further actions needs to be taken. Click Next to proceed.]]>
+ The Default user has been disabled or has no access to Umbraco!No further actions needs to be taken. Click Next to proceed.]]>
The Default user's password has been successfully changed since the installation!
No further actions needs to be taken. Click Next to proceed.]]>
The password is changed!
@@ -1873,7 +1873,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Keep all versions newer than days
Keep latest version per day for days
Prevent cleanup
- NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.]]>
+ NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.]]>
Add language
@@ -2611,12 +2611,12 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Umbraco currently runs in debug mode. This means you can use the built-in performance profiler to assess the performance when rendering pages.
- If you want to activate the profiler for a specific page rendering, simply add umbDebug=true to the querystring when requesting the page.
+ If you want to activate the profiler for a specific page rendering, simply add umbDebug=true to the querystring when requesting the page.
If you want the profiler to be activated by default for all page renderings, you can use the toggle below.
It will set a cookie in your browser, which then activates the profiler automatically.
- In other words, the profiler will only be active by default in your browser - not everyone else's.
+ In other words, the profiler will only be active by default in your browser - not everyone else's.
]]>
@@ -2625,7 +2625,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
- You should never let a production site run in debug mode. Debug mode is turned off by setting Umbraco:CMS:Hosting:Debug to false in appsettings.json, appsettings.{Environment}.json or via an environment variable.
+ You should never let a production site run in debug mode. Debug mode is turned off by setting Umbraco:CMS:Hosting:Debug to false in appsettings.json, appsettings.{Environment}.json or via an environment variable.
]]>
@@ -2635,7 +2635,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Umbraco currently does not run in debug mode, so you can't use the built-in profiler. This is how it should be for a production site.
- Debug mode is turned on by setting Umbraco:CMS:Hosting:Debug to true in appsettings.json, appsettings.{Environment}.json or via an environment variable.
+ Debug mode is turned on by setting Umbraco:CMS:Hosting:Debug to true in appsettings.json, appsettings.{Environment}.json or via an environment variable.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
index 88030198a3..9a44528b53 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
@@ -483,10 +483,10 @@
Name
Close this window
Are you sure you want to delete
- %0% of %1% items]]>
+ %0% of %1% items]]>
Are you sure you want to disable
Are you sure you want to remove
- %0%]]>
+ %0%]]>
Are you sure?
Are you sure?
Cut
@@ -579,8 +579,8 @@
This will delete the node and all its languages. If you only want to delete one
language, you should unpublish the node in that language instead.
- %0%.]]>
- %0% from the %1% group]]>
+ %0%.]]>
+ %0% from the %1% group]]>
Yes, remove
You are deleting the layout
Modifying layout will result in loss of data for any existing content that is based on this configuration.
@@ -975,7 +975,7 @@
The Default users' password needs to be changed!]]>
- The Default user has been disabled or has no access to Umbraco!No further actions needs to be taken. Click Next to proceed.]]>
+ The Default user has been disabled or has no access to Umbraco!No further actions needs to be taken. Click Next to proceed.]]>
The Default user's password has been successfully changed since the installation!
No further actions needs to be taken. Click Next to proceed.]]>
The password is changed!
@@ -1947,7 +1947,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Keep all versions newer than days
Keep latest version per day for days
Prevent cleanup
- NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.]]>
+ NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.]]>
Changing a data type with stored values is disabled. To allow this you can change the Umbraco:CMS:DataTypes:CanBeChanged setting in appsettings.json.
@@ -2717,12 +2717,12 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Umbraco currently runs in debug mode. This means you can use the built-in performance profiler to assess the performance when rendering pages.
- If you want to activate the profiler for a specific page rendering, simply add umbDebug=true to the querystring when requesting the page.
+ If you want to activate the profiler for a specific page rendering, simply add umbDebug=true to the querystring when requesting the page.
If you want the profiler to be activated by default for all page renderings, you can use the toggle below.
It will set a cookie in your browser, which then activates the profiler automatically.
- In other words, the profiler will only be active by default in your browser - not everyone else's.
+ In other words, the profiler will only be active by default in your browser - not everyone else's.
]]>
@@ -2731,7 +2731,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
- You should never let a production site run in debug mode. Debug mode is turned off by setting Umbraco:CMS:Hosting:Debug to false in appsettings.json, appsettings.{Environment}.json or via an environment variable.
+ You should never let a production site run in debug mode. Debug mode is turned off by setting Umbraco:CMS:Hosting:Debug to false in appsettings.json, appsettings.{Environment}.json or via an environment variable.
]]>
@@ -2741,7 +2741,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Umbraco currently does not run in debug mode, so you can't use the built-in profiler. This is how it should be for a production site.
- Debug mode is turned on by setting Umbraco:CMS:Hosting:Debug to true in appsettings.json, appsettings.{Environment}.json or via an environment variable.
+ Debug mode is turned on by setting Umbraco:CMS:Hosting:Debug to true in appsettings.json, appsettings.{Environment}.json or via an environment variable.
]]>
@@ -2910,22 +2910,22 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Aggregate data will be shared on a regular basis as well as learnings from these metrics.
Hopefully, you will help us collect some valuable data.
- We WILL NOT collect any personal data such as content, code, user information, and all data will be fully anonymized.
+ We WILL NOT collect any personal data such as content, code, user information, and all data will be fully anonymized.
]]>
We will only send an anonymized site ID to let us know that the site exists.
- We will send an anonymized site ID, Umbraco version, and packages installed
+ We will send an anonymized site ID, umbraco version, and packages installed
- Anonymized site ID, Umbraco version, and packages installed.
+ Anonymized site ID, umbraco version, and packages installed.
Number of: Root nodes, Content nodes, Macros, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, and Property Editors in use.
System information: Webserver, server OS, server framework, server OS language, and database provider.
Configuration settings: Modelsbuilder mode, if custom Umbraco path exists, ASP environment, and if you are in debug mode.
- We might change what we send on the Detailed level in the future. If so, it will be listed above.
- By choosing "Detailed" you agree to current and future anonymized information being collected.
+ We might change what we send on the Detailed level in the future. If so, it will be listed above.
+ By choosing "Detailed" you agree to current and future anonymized information being collected.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml
index 3e59088ef9..2c64f3f9a6 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/es.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/es.xml
@@ -601,7 +601,7 @@
Pincha en Próximo para continuar. ]]>
próximo para continuar con el asistente de configuración]]>
La contraseña del usuario por defecto debe ser cambiada]]>
- El usuario por defecto ha sido deshabilitado o ha perdido el acceso a Umbraco!Pincha en Próximo para continuar.]]>
+ El usuario por defecto ha sido deshabilitado o ha perdido el acceso a Umbraco!Pincha en Próximo para continuar.]]>
¡La contraseña del usuario por defecto ha sido cambiada desde que se instaló!No hay que realizar ninguna tarea más. Pulsa Siguiente para proseguir.]]>
¡La contraseña se ha cambiado!
Ten un buen comienzo, visita nuestros videos de introducción
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
index 24d5f565e5..9013a4473f 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/fr.xml
@@ -390,7 +390,7 @@
Nom
Fermer cette fenêtre
Êtes-vous certain(e) de vouloir supprimer
- %0% des %1% éléments]]>
+ %0% des %1% éléments]]>
Êtes-vous certain(e) de vouloir désactiver
Êtes-vous certain(e)?
Êtes-vous certain(e)?
@@ -799,7 +799,7 @@
poursuivre. ]]>
Suivant pour poursuivre la configuration]]>
Le mot de passe par défaut doit être modifié !]]>
- L'utilisateur par défaut a été désactivé ou n'a pas accès à Umbraco!Aucune autre action n'est requise. Cliquez sur Suivant pour poursuivre.]]>
+ L'utilisateur par défaut a été désactivé ou n'a pas accès à Umbraco!Aucune autre action n'est requise. Cliquez sur Suivant pour poursuivre.]]>
Le mot de passe par défaut a été modifié avec succès depuis l'installation!Aucune autre action n'est requise. Cliquez sur Suivant pour poursuivre.]]>
Le mot de passe a été modifié !
Pour bien commencer, regardez nos vidéos d'introduction
@@ -2177,12 +2177,12 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à
Umbraco est actuellement exécuté en mode debug. Cela signifie que vous pouvez utiliser le profileur de performances intégré pour évaluer les performance lors du rendu des pages.
- Si vous souhaitez activer le profileur pour le rendu d'une page spécifique, ajoutez simplement umbDebug=true au querystring lorsque vous demandez la page.
+ Si vous souhaitez activer le profileur pour le rendu d'une page spécifique, ajoutez simplement umbDebug=true au querystring lorsque vous demandez la page.
Si vous souhaitez que le profileur soit activé par défaut pour tous les rendus de pages, vous pouvez utiliser le bouton bascule ci-dessous.
Cela créera un cookie dans votre browser, qui activera alors le profileur automatiquement.
- En d'autres termes, le profileur ne sera activé par défaut que dans votre browser - pas celui des autres.
+ En d'autres termes, le profileur ne sera activé par défaut que dans votre browser - pas celui des autres.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/he.xml b/src/Umbraco.Core/EmbeddedResources/Lang/he.xml
index c52961307d..0996c81ba0 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/he.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/he.xml
@@ -366,7 +366,7 @@
proceed. ]]>
next to continue the configuration wizard]]>
The Default users’ password needs to be changed!]]>
- The Default user has been disabled or has no access to Umbraco!No further actions needs to be taken. Click Next to proceed.]]>
+ The Default user has been disabled or has no access to Umbraco!No further actions needs to be taken. Click Next to proceed.]]>
The Default user's password has been successfully changed since the installation!No further actions needs to be taken. Click Next to proceed.]]>
הסיסמה שונתה!
התחל מכאן, צפה בסרטוני ההדרכה עבור אומברקו
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/it.xml b/src/Umbraco.Core/EmbeddedResources/Lang/it.xml
index cea82fc4e0..23bff095a3 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/it.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/it.xml
@@ -487,8 +487,8 @@
Sei sicuro di voler eliminare
Sei sicuro di voler disabilitare
Sei sicuro di voler rimuovere
- %0%]]>
- %0%]]>
+ %0%]]>
+ %0%]]>
Taglia
@@ -574,8 +574,8 @@
Seleziona snippet
- %0%.]]>
- %0% dal gruppo %1% ]]>
+ %0%.]]>
+ %0% dal gruppo %1% ]]>
Si, rimuovi
@@ -2767,12 +2767,12 @@ Per gestire il tuo sito web, è sufficiente aprire il backoffice di Umbraco e in
Umbraco attualmente funziona in modalità debug. Ciò significa che puoi utilizzare il profiler delle prestazioni integrato per valutare le prestazioni durante il rendering delle pagine.
- Se vuoi attivare il profiler per il rendering di una pagina specifica, aggiungi semplicemente umbDebug=true alla querystring quando richiedi la pagina.
+ Se vuoi attivare il profiler per il rendering di una pagina specifica, aggiungi semplicemente umbDebug=true alla querystring quando richiedi la pagina.
Se vuoi che il profiler sia attivato per impostazione predefinita per tutti i rendering di pagina, puoi utilizzare l'interruttore qui sotto.
Verrà impostato un cookie nel tuo browser, che quindi attiverà automaticamente il profiler.
- In altre parole, il profiler sarà attivo per impostazione predefinita solo nel tuo browser, non in quello di tutti gli altri.
+ In altre parole, il profiler sarà attivo per impostazione predefinita solo nel tuo browser, non in quello di tutti gli altri.
]]>
@@ -2781,7 +2781,7 @@ Per gestire il tuo sito web, è sufficiente aprire il backoffice di Umbraco e in
- Non dovresti mai lasciare che un sito di produzione venga eseguito in modalità debug. La modalità di debug viene disattivata impostando debug="false" nell'elemento <compilation /> nel file web.config.
+ Non dovresti mai lasciare che un sito di produzione venga eseguito in modalità debug. La modalità di debug viene disattivata impostando debug="false" nell'elemento <compilation /> nel file web.config.
]]>
@@ -2791,7 +2791,7 @@ Per gestire il tuo sito web, è sufficiente aprire il backoffice di Umbraco e in
Umbraco attualmente non viene eseguito in modalità debug, quindi non è possibile utilizzare il profiler integrato. Questo è come dovrebbe essere per un sito produttivo.
- La modalità di debug viene attivata impostando debug="true" nell'elemento <compilation /> in web.config.
+ La modalità di debug viene attivata impostando debug="true" nell'elemento <compilation /> in web.config.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml b/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml
index bcf9e8c9a9..2d4c80570b 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/ja.xml
@@ -481,7 +481,7 @@
を押して続行してください。]]>
次へ をクリックして設定ウィザードを進めてください。]]>
デフォルトユーザーのパスワードを変更する必要があります!]]>
- デフォルトユーザーは無効化されているかUmbracoにアクセスできない状態になっています!これ以上のアクションは必要ありません。次へ をクリックして続行してください。]]>
+ デフォルトユーザーは無効化されているかUmbracoにアクセスできない状態になっています!これ以上のアクションは必要ありません。次へ をクリックして続行してください。]]>
インストール後にデフォルトユーザーのパスワードが変更されています!これ以上のアクションは必要ありません。次へ をクリックして続行してください。]]>
パスワードは変更されました!
始めに、ビデオによる解説を見ましょう
@@ -555,7 +555,7 @@ Runwayをインストールして作られた新しいウェブサイトがど
Umbraco Version 3
Umbraco Version 4
見る
- Umbraco %0% の新規インストールまたは3.0からの更新について設定方法を案内します。
+ umbraco %0% の新規インストールまたは3.0からの更新について設定方法を案内します。
"次へ" を押してウィザードを開始します。]]>
@@ -849,9 +849,9 @@ Runwayをインストールして作られた新しいウェブサイトがど
コンテンツ領域プレースホルダーの挿入
ディクショナリ アイテムを挿入
マクロの挿入
- Umbraco ページフィールドの挿入
+ umbraco ページフィールドの挿入
マスターテンプレート
- Umbraco テンプレートタグのクイックガイド
+ umbraco テンプレートタグのクイックガイド
テンプレート
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml b/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml
index 6a20975bb1..852d8765aa 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/ko.xml
@@ -357,7 +357,7 @@
계속 진행하시려면 다음 을 누르세요. ]]>
다음을 클릭하시면 설정마법사를 계속 진행합니다.]]>
기본 사용자의 암호가 변경되어야 합니다!]]>
- 기본 사용자가 비활성화되었거나 Umbraco에 접근할 수 없습니다!더 이상 과정이 필요없으시면 다음 을 눌러주세요.]]>
+ 기본 사용자가 비활성화되었거나 Umbraco에 접근할 수 없습니다!더 이상 과정이 필요없으시면 다음 을 눌러주세요.]]>
설치후 기본사용자의 암호가 성공적으로 변경되었습니다!더 이상 과정이 필요없으시면 다음 을 눌러주세요.]]>
비밀번호가 변경되었습니다!
편리한 시작을 위해, 소개 Video를 시청하세요
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml b/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml
index 87bcb3138a..30d2da3e4f 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/nb.xml
@@ -420,7 +420,7 @@
Trykk Neste for å fortsette.]]>
neste for å fortsette konfigurasjonsveiviseren]]>
Passordet til standardbrukeren må endres!]]>
- Standardbrukeren har blitt deaktivert eller har ingen tilgang til Umbraco!Ingen videre handling er nødvendig. Klikk neste for å fortsette.]]>
+ Standardbrukeren har blitt deaktivert eller har ingen tilgang til Umbraco!Ingen videre handling er nødvendig. Klikk neste for å fortsette.]]>
Passordet til standardbrukeren har blitt forandret etter installasjonen!Ingen videre handling er nødvendig. Klikk Neste for å fortsette.]]>
Passordet er blitt endret!
Få en god start med våre introduksjonsvideoer
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml
index 28793081b7..163fd14199 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/nl.xml
@@ -439,7 +439,7 @@
Weet je zeker dat je dit wilt verwijderen
Weet je zeker dat je dit wilt uitschakelen
Weet u zeker dat u wilt verwijderen
- %0% wil verwijderen]]>
+ %0% wil verwijderen]]>
Weet je het zeker?
Weet je het zeker?
Knippen
@@ -529,8 +529,8 @@
Dit zal de node en al zijn talen verwijderen. Als je slechts één taal wil
verwijderen, moet je de node in die taal depubliceren.
- %0% verwijderen.]]>
- %0% verwijderen van de %1% groep]]>
+ %0% verwijderen.]]>
+ %0% verwijderen van de %1% groep]]>
Ja, verwijderen
@@ -889,7 +889,7 @@
Het wachtwoord van de default gebruiker dient veranderd te worden!]]>
- De default gebruiker is geblokkeerd of heeft geen toegang tot Umbraco!Geen verdere actie noodzakelijk. Klik Volgende om verder te gaan.]]>
+ De default gebruiker is geblokkeerd of heeft geen toegang tot Umbraco!Geen verdere actie noodzakelijk. Klik Volgende om verder te gaan.]]>
Het wachtwoord van de default gebruiker is sinds installatie met succes veranderd.Geen verdere actie noodzakelijk. Klik Volgende om verder te gaan.]]>
Het wachtwoord is veranderd!
@@ -2399,12 +2399,12 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je
Umbraco wordt uitgevoerd in de foutopsporingsmodus. Dit betekent dat u de ingebouwde prestatieprofiler kunt gebruiken om de prestaties te beoordelen bij het renderen van pagina's.
- Als je de profiler voor een specifieke paginaweergave wilt activeren, voeg je umbDebug=true toe aan de querystring wanneer je de pagina opvraagt.
+ Als je de profiler voor een specifieke paginaweergave wilt activeren, voeg je umbDebug=true toe aan de querystring wanneer je de pagina opvraagt.
Als je wil dat de profiler standaard wordt geactiveerd voor alle paginaweergaven, kun je de onderstaande schakelaar gebruiken.
Het plaatst een cookie in je browser, die vervolgens de profiler automatisch activeert.
- Met andere woorden, de profiler zal alleen voor jouw browser actief zijn, niet voor andere bezoekers.
+ Met andere woorden, de profiler zal alleen voor jouw browser actief zijn, niet voor andere bezoekers.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml b/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml
index 25060a4bd3..39d0cfc4a1 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/pt.xml
@@ -358,7 +358,7 @@
Pressione Próximo para prosseguir.]]>
próximo para continuar com o assistente de configuração]]>
A senha do usuário padrão precisa ser alterada!]]>
- O usuário padrão foi desabilitado ou não tem acesso à Umbraco!Nenhuma ação posterior precisa ser tomada. Clique Próximo para prosseguir.]]>
+ O usuário padrão foi desabilitado ou não tem acesso à Umbraco!Nenhuma ação posterior precisa ser tomada. Clique Próximo para prosseguir.]]>
A senha do usuário padrão foi alterada com sucesso desde a instalação!Nenhuma ação posterior é necessária. Clique Próximo para prosseguir.]]>
Senha foi alterada!
Comece com o pé direito, assista nossos vídeos introdutórios
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
index fa359fbbbc..af3f157bf4 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/sv.xml
@@ -493,7 +493,7 @@
Tryck Nästa för att fortsätta.]]>
Nästa för att fortsätta med konfigurationsguiden]]>
Lösenordet på standardanvändaren måste bytas!]]>
- Standardanvändaren har avaktiverats eller har inte åtkomst till Umbraco!Du behöver inte göra något ytterligare här. Klicka Next för att fortsätta.]]>
+ Standardanvändaren har avaktiverats eller har inte åtkomst till Umbraco!Du behöver inte göra något ytterligare här. Klicka Next för att fortsätta.]]>
Standardanvändarens lösenord har ändrats sedan installationen!Du behöver inte göra något ytterligare här. Klicka Nästa för att fortsätta.]]>
Lösenordet är ändrat!
Få en flygande start, kolla på våra introduktionsvideor
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml b/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
index 47549f5f40..3ef3db0ad6 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/tr.xml
@@ -393,7 +393,7 @@
Silmek istediğinizden emin misiniz
Devre dışı bırakmak istediğinizden emin misiniz
Kaldırmak istediğinizden emin misiniz
- %0% kullanımını kaldırmak istediğinizden emin misiniz?]]>
+ %0% kullanımını kaldırmak istediğinizden emin misiniz?]]>
Emin misiniz?
Emin misiniz?
Kes
@@ -471,8 +471,8 @@
Düzenleyici seçin
Snippet seçin
Bu, düğümü ve tüm dillerini silecektir. Yalnızca bir dili silmek istiyorsanız, bunun yerine düğümü o dilde yayından kaldırmalısınız.
- %0% kullanıcısını kaldıracaktır.]]>
- %0% kullanıcısını %1% grubundan kaldıracak]]>
+ %0% kullanıcısını kaldıracaktır.]]>
+ %0% kullanıcısını %1% grubundan kaldıracak]]>
Evet, kaldır
@@ -818,7 +818,7 @@
ileri 'yi tıklayın]]>
Varsayılan kullanıcıların şifresinin değiştirilmesi gerekiyor! ]]>
- Varsayılan kullanıcı devre dışı bırakıldı veya Umbraco'ya erişimi yok! Başka işlem yapılmasına gerek yok. Devam etmek için İleri 'yi tıklayın.]]>
+ Varsayılan kullanıcı devre dışı bırakıldı veya Umbraco'ya erişimi yok! Başka işlem yapılmasına gerek yok. Devam etmek için İleri 'yi tıklayın.]]>
Varsayılan kullanıcının şifresi kurulumdan bu yana başarıyla değiştirildi! Başka işlem yapılmasına gerek yok. Devam etmek için İleri 'yi tıklayın.]]>
Şifre değiştirildi!
Harika bir başlangıç yapın, tanıtım videolarımızı izleyin
@@ -2289,12 +2289,12 @@ Web sitenizi yönetmek için, Umbraco'nun arka ofisini açın ve içerik eklemey
Umbraco şu anda hata ayıklama modunda çalışıyor. Bu, sayfaları işlerken performansı değerlendirmek için yerleşik performans profilleyicisini kullanabileceğiniz anlamına gelir.
- Profil oluşturucuyu belirli bir sayfa oluşturma için etkinleştirmek istiyorsanız, sayfayı talep ederken sorgu dizesine umbDebug=true eklemeniz yeterlidir.
+ Profil oluşturucuyu belirli bir sayfa oluşturma için etkinleştirmek istiyorsanız, sayfayı talep ederken sorgu dizesine umbDebug=true eklemeniz yeterlidir.
Profilcinin tüm sayfa görüntülemeleri için varsayılan olarak etkinleştirilmesini istiyorsanız, aşağıdaki geçişi kullanabilirsiniz.
Tarayıcınızda, profil oluşturucuyu otomatik olarak etkinleştiren bir çerez ayarlayacaktır.
- Başka bir deyişle, profil oluşturucu yalnızca tarayıcınızda varsayılan olarak etkin olacaktır - diğer herkesin değil.
+ Başka bir deyişle, profil oluşturucu yalnızca tarayıcınızda varsayılan olarak etkin olacaktır - diğer herkesin değil.
]]>
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml b/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml
index 5d9a6e9ab3..d8132c151b 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/zh.xml
@@ -501,7 +501,7 @@
点击下一步 继续。]]>
下一步继续]]>
需要修改默认密码!]]>
- 默认账户已禁用或无权访问系统!点击下一步 继续。]]>
+ 默认账户已禁用或无权访问系统!点击下一步 继续。]]>
安装过程中默认用户密码已更改点击下一步 继续。]]>
密码已更改
作为入门者,从视频教程开始吧!
diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml b/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml
index b3e3b7bdcf..216dc3d0fe 100644
--- a/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml
+++ b/src/Umbraco.Core/EmbeddedResources/Lang/zh_tw.xml
@@ -493,8 +493,8 @@
點選下一步 繼續。]]>
下一步繼續設定精靈。]]>
預設使用者的密碼必須更改!]]>
- 預設使用者已經被暫停或沒有Umbraco的使用權!不需更多的操作步驟。點選下一步 繼續。]]>
- 安裝後預設使用者的密碼已經成功修改!不需更多的操作步驟。點選下一步 繼續。]]>
+ 預設使用者已經被暫停或沒有Umbraco的使用權!不需更多的操作步驟。點選下一步 繼續。]]>
+ 安裝後預設使用者的密碼已經成功修改!不需更多的操作步驟。點選下一步 繼續。]]>
密碼已更改
作為入門者,從視頻教程開始吧!
安裝失敗。
diff --git a/src/Umbraco.Core/Extensions/EnumExtensions.cs b/src/Umbraco.Core/Extensions/EnumExtensions.cs
index c88a2d8b2f..3aa124d2f3 100644
--- a/src/Umbraco.Core/Extensions/EnumExtensions.cs
+++ b/src/Umbraco.Core/Extensions/EnumExtensions.cs
@@ -1,31 +1,42 @@
-// Copyright (c) Umbraco.
+// Copyright (c) Umbraco.
// See LICENSE for more details.
-using System;
+namespace Umbraco.Extensions;
-namespace Umbraco.Extensions
+///
+/// Provides extension methods to .
+///
+public static class EnumExtensions
{
///
- /// Provides extension methods to .
+ /// Determines whether all the flags/bits are set within the enum value.
///
- public static class EnumExtensions
- {
- ///
- /// Determines whether any of the flags/bits are set within the enum value.
- ///
- /// The enum type.
- /// The value.
- /// The flags.
- ///
- /// true if any of the flags/bits are set within the enum value; otherwise, false .
- ///
- public static bool HasFlagAny(this T value, T flags)
- where T : Enum
- {
- var v = Convert.ToUInt64(value);
- var f = Convert.ToUInt64(flags);
+ /// The enum type.
+ /// The enum value.
+ /// The flags.
+ ///
+ /// true if all the flags/bits are set within the enum value; otherwise, false .
+ ///
+ [Obsolete("Use Enum.HasFlag() or bitwise operations (if performance is important) instead.")]
+ public static bool HasFlagAll(this T value, T flags)
+ where T : Enum =>
+ value.HasFlag(flags);
- return (v & f) > 0;
- }
+ ///
+ /// Determines whether any of the flags/bits are set within the enum value.
+ ///
+ /// The enum type.
+ /// The value.
+ /// The flags.
+ ///
+ /// true if any of the flags/bits are set within the enum value; otherwise, false .
+ ///
+ public static bool HasFlagAny(this T value, T flags)
+ where T : Enum
+ {
+ var v = Convert.ToUInt64(value);
+ var f = Convert.ToUInt64(flags);
+
+ return (v & f) > 0;
}
}
diff --git a/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs b/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs
index 8699950b37..475f093785 100644
--- a/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs
+++ b/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs
@@ -7,13 +7,13 @@ namespace Umbraco.Extensions;
///
/// Get concatenated user and default character replacements
-/// taking into account .
+/// taking into account
///
public static class RequestHandlerSettingsExtension
{
///
/// Get concatenated user and default character replacements
- /// taking into account .
+ /// taking into account
///
public static IEnumerable GetCharReplacements(this RequestHandlerSettings requestHandlerSettings)
{
@@ -28,8 +28,31 @@ public static class RequestHandlerSettingsExtension
return RequestHandlerSettings.DefaultCharCollection;
}
- /// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection.
- return MergeUnique(requestHandlerSettings.UserDefinedCharCollection, RequestHandlerSettings.DefaultCharCollection);
+ return MergeUnique(
+ requestHandlerSettings.UserDefinedCharCollection,
+ RequestHandlerSettings.DefaultCharCollection);
+ }
+
+ ///
+ /// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection
+ ///
+ internal static void MergeReplacements(
+ this RequestHandlerSettings requestHandlerSettings,
+ IConfiguration configuration)
+ {
+ var sectionKey = $"{Constants.Configuration.ConfigRequestHandler}:";
+
+ IEnumerable charCollection = GetReplacements(
+ configuration,
+ $"{sectionKey}{nameof(RequestHandlerSettings.CharCollection)}");
+
+ IEnumerable userDefinedCharCollection = GetReplacements(
+ configuration,
+ $"{sectionKey}{nameof(requestHandlerSettings.UserDefinedCharCollection)}");
+
+ IEnumerable mergedCollection = MergeUnique(userDefinedCharCollection, charCollection);
+
+ requestHandlerSettings.UserDefinedCharCollection = mergedCollection;
}
private static IEnumerable GetReplacements(IConfiguration configuration, string key)
@@ -41,12 +64,6 @@ public static class RequestHandlerSettingsExtension
{
var @char = section.GetValue(nameof(CharItem.Char));
var replacement = section.GetValue(nameof(CharItem.Replacement));
-
- if (@char is null || replacement is null)
- {
- continue;
- }
-
replacements.Add(new CharItem { Char = @char, Replacement = replacement });
}
@@ -54,7 +71,8 @@ public static class RequestHandlerSettingsExtension
}
///
- /// Merges two IEnumerable of CharItem without any duplicates, items in priorityReplacements will override those in alternativeReplacements.
+ /// Merges two IEnumerable of CharItem without any duplicates, items in priorityReplacements will override those in
+ /// alternativeReplacements
///
private static IEnumerable MergeUnique(
IEnumerable priorityReplacements,
diff --git a/src/Umbraco.Core/Extensions/StringExtensions.cs b/src/Umbraco.Core/Extensions/StringExtensions.cs
index 790444c4bc..694b4d05e6 100644
--- a/src/Umbraco.Core/Extensions/StringExtensions.cs
+++ b/src/Umbraco.Core/Extensions/StringExtensions.cs
@@ -1326,8 +1326,11 @@ public static class StringExtensions
///
///
// From: http://stackoverflow.com/a/35046453/5018
- // Updated from .NET 2.1+: https://stackoverflow.com/a/58250915
- public static bool IsFullPath(this string path) => Path.IsPathFullyQualified(path);
+ public static bool IsFullPath(this string path) =>
+ string.IsNullOrWhiteSpace(path) == false
+ && path.IndexOfAny(Path.GetInvalidPathChars().ToArray()) == -1
+ && Path.IsPathRooted(path)
+ && Path.GetPathRoot(path)?.Equals(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) == false;
// FORMAT STRINGS
diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs
index 9a0ecf57ae..5e830e1f61 100644
--- a/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs
+++ b/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs
@@ -19,6 +19,18 @@ public abstract class BaseHttpHeaderCheck : HealthCheck
private readonly string _localizedTextPrefix;
private readonly bool _metaTagOptionAvailable;
+ [Obsolete("Use ctor without value.")]
+ protected BaseHttpHeaderCheck(
+ IHostingEnvironment hostingEnvironment,
+ ILocalizedTextService textService,
+ string header,
+ string value,
+ string localizedTextPrefix,
+ bool metaTagOptionAvailable)
+ : this(hostingEnvironment, textService, header, localizedTextPrefix, metaTagOptionAvailable)
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
diff --git a/src/Umbraco.Core/Hosting/IHostingEnvironment.cs b/src/Umbraco.Core/Hosting/IHostingEnvironment.cs
index 1dfa72039c..b8960048f6 100644
--- a/src/Umbraco.Core/Hosting/IHostingEnvironment.cs
+++ b/src/Umbraco.Core/Hosting/IHostingEnvironment.cs
@@ -2,7 +2,7 @@ namespace Umbraco.Cms.Core.Hosting;
public interface IHostingEnvironment
{
- string? SiteName { get; }
+ string SiteName { get; }
///
/// The unique application ID for this Umbraco website.
diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs
index 42e0978b3d..cffd2780da 100644
--- a/src/Umbraco.Core/IO/IOHelper.cs
+++ b/src/Umbraco.Core/IO/IOHelper.cs
@@ -53,7 +53,8 @@ public abstract class IOHelper : IIOHelper
throw new ArgumentNullException(nameof(path));
}
- if (path.IsFullPath())
+ // Check if the path is already mapped - TODO: This should be switched to Path.IsPathFullyQualified once we are on Net Standard 2.1
+ if (IsPathFullyQualified(path))
{
return path;
}
@@ -230,7 +231,13 @@ public abstract class IOHelper : IIOHelper
: CleanFolderResult.Success();
}
- [Obsolete("Use Path.IsPathFullyQualified instead. This will be removed in Umbraco 13.")]
-
- public virtual bool IsPathFullyQualified(string path) => Path.IsPathFullyQualified(path);
+ ///
+ /// Returns true if the path has a root, and is considered fully qualified for the OS it is on
+ /// See
+ /// https://github.com/dotnet/runtime/blob/30769e8f31b20be10ca26e27ec279cd4e79412b9/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs#L281
+ /// for the .NET Standard 2.1 version of this
+ ///
+ /// The path to check
+ /// True if the path is fully qualified, false otherwise
+ public abstract bool IsPathFullyQualified(string path);
}
diff --git a/src/Umbraco.Core/IO/IOHelperLinux.cs b/src/Umbraco.Core/IO/IOHelperLinux.cs
index 239d43a605..7d936895a1 100644
--- a/src/Umbraco.Core/IO/IOHelperLinux.cs
+++ b/src/Umbraco.Core/IO/IOHelperLinux.cs
@@ -9,6 +9,8 @@ public class IOHelperLinux : IOHelper
{
}
+ public override bool IsPathFullyQualified(string path) => Path.IsPathRooted(path);
+
public override bool PathStartsWith(string path, string root, params char[] separators)
{
// either it is identical to root,
diff --git a/src/Umbraco.Core/IO/IOHelperOSX.cs b/src/Umbraco.Core/IO/IOHelperOSX.cs
index d939e0f146..8b8ed20939 100644
--- a/src/Umbraco.Core/IO/IOHelperOSX.cs
+++ b/src/Umbraco.Core/IO/IOHelperOSX.cs
@@ -9,6 +9,8 @@ public class IOHelperOSX : IOHelper
{
}
+ public override bool IsPathFullyQualified(string path) => Path.IsPathRooted(path);
+
public override bool PathStartsWith(string path, string root, params char[] separators)
{
// either it is identical to root,
diff --git a/src/Umbraco.Core/IO/IOHelperWindows.cs b/src/Umbraco.Core/IO/IOHelperWindows.cs
index 4325b56108..9dfec76f36 100644
--- a/src/Umbraco.Core/IO/IOHelperWindows.cs
+++ b/src/Umbraco.Core/IO/IOHelperWindows.cs
@@ -9,6 +9,35 @@ public class IOHelperWindows : IOHelper
{
}
+ public override bool IsPathFullyQualified(string path)
+ {
+ // TODO: This implementation is taken from the .NET Standard 2.1 implementation. We should switch to using Path.IsPathFullyQualified once we are on .NET Standard 2.1
+ if (path.Length < 2)
+ {
+ // It isn't fixed, it must be relative. There is no way to specify a fixed
+ // path with one character (or less).
+ return false;
+ }
+
+ if (path[0] == Path.DirectorySeparatorChar || path[0] == Path.AltDirectorySeparatorChar)
+ {
+ // There is no valid way to specify a relative path with two initial slashes or
+ // \? as ? isn't valid for drive relative paths and \??\ is equivalent to \\?\
+ return path[1] == '?' || path[1] == Path.DirectorySeparatorChar ||
+ path[1] == Path.AltDirectorySeparatorChar;
+ }
+
+ // The only way to specify a fixed path that doesn't begin with two slashes
+ // is the drive, colon, slash format- i.e. C:\
+ return path.Length >= 3
+ && path[1] == Path.VolumeSeparatorChar
+ && (path[2] == Path.DirectorySeparatorChar || path[2] == Path.AltDirectorySeparatorChar)
+
+ // To match old behavior we'll check the drive character for validity as the path is technically
+ // not qualified if you don't have a valid drive. "=:\" is the "=" file's default data stream.
+ && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z'));
+ }
+
public override bool PathStartsWith(string path, string root, params char[] separators)
{
// either it is identical to root,
diff --git a/src/Umbraco.Core/IO/ViewHelper.cs b/src/Umbraco.Core/IO/ViewHelper.cs
index e68101918a..e2502e4669 100644
--- a/src/Umbraco.Core/IO/ViewHelper.cs
+++ b/src/Umbraco.Core/IO/ViewHelper.cs
@@ -11,11 +11,21 @@ public class ViewHelper : IViewHelper
private readonly IDefaultViewContentProvider _defaultViewContentProvider;
private readonly IFileSystem _viewFileSystem;
- public ViewHelper(FileSystems fileSystems, IDefaultViewContentProvider defaultViewContentProvider)
- {
- _viewFileSystem = fileSystems.MvcViewsFileSystem ?? throw new ArgumentNullException(nameof(fileSystems));
- _defaultViewContentProvider = defaultViewContentProvider ?? throw new ArgumentNullException(nameof(defaultViewContentProvider));
- }[Obsolete("Inject IDefaultViewContentProvider instead")]
+ [Obsolete("Use ctor with all params")]
+ public ViewHelper(IFileSystem viewFileSystem)
+ {
+ _viewFileSystem = viewFileSystem ?? throw new ArgumentNullException(nameof(viewFileSystem));
+ _defaultViewContentProvider = StaticServiceProvider.Instance.GetRequiredService();
+ }
+
+ public ViewHelper(FileSystems fileSystems, IDefaultViewContentProvider defaultViewContentProvider)
+ {
+ _viewFileSystem = fileSystems.MvcViewsFileSystem ?? throw new ArgumentNullException(nameof(fileSystems));
+ _defaultViewContentProvider = defaultViewContentProvider ??
+ throw new ArgumentNullException(nameof(defaultViewContentProvider));
+ }
+
+ [Obsolete("Inject IDefaultViewContentProvider instead")]
public static string GetDefaultFileContent(string? layoutPageAlias = null, string? modelClassName = null, string? modelNamespace = null, string? modelNamespaceAlias = null)
{
IDefaultViewContentProvider viewContentProvider =
diff --git a/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs b/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs
index 17b89d8ec0..6db33486f5 100644
--- a/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs
+++ b/src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs
@@ -29,11 +29,20 @@ public class TelemetryIdentifierStep : InstallSetupStep
_siteIdentifierService = siteIdentifierService;
}
- public override Task ExecuteAsync(object model)
- {
- _siteIdentifierService.TryCreateSiteIdentifier(out _);
- return Task.FromResult(null);
- }
+ [Obsolete("Use constructor that takes GlobalSettings and ISiteIdentifierService")]
+ public TelemetryIdentifierStep(
+ ILogger logger,
+ IOptions globalSettings,
+ IConfigManipulator configManipulator)
+ : this(globalSettings, StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
+ public override Task ExecuteAsync(object model)
+ {
+ _siteIdentifierService.TryCreateSiteIdentifier(out _);
+ return Task.FromResult(null);
+ }
public override bool RequiresExecution(object model)
{
diff --git a/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs b/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs
index 3953fdd2b7..ab3c36031c 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs
@@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Dailymotion the popular online video-sharing platform.
///
-public class DailyMotion : OEmbedProviderBase
+public class DailyMotion : EmbedProviderBase
{
public DailyMotion(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/EmbedProviderBase.cs b/src/Umbraco.Core/Media/EmbedProviders/EmbedProviderBase.cs
index e51005b84b..d0a8727442 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/EmbedProviderBase.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/EmbedProviderBase.cs
@@ -2,7 +2,7 @@ using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders;
-[Obsolete("Use OEmbedProviderBase instead")]
+[Obsolete("Use OEmbedProviderBase instead- This will be removed in Umbraco 12")]
public abstract class EmbedProviderBase : OEmbedProviderBase
{
protected EmbedProviderBase(IJsonSerializer jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs b/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs
index 7738981fe9..e1842ed238 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Flickr the popular online image hosting and video hosting service.
///
-public class Flickr : OEmbedProviderBase
+public class Flickr : EmbedProviderBase
{
public Flickr(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs b/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs
index 5341580967..cd045d7df3 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Getty Images supplier of stock images, editorial photography, video and music for business and consumers.
///
-public class GettyImages : OEmbedProviderBase
+public class GettyImages : EmbedProviderBase
{
public GettyImages(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs b/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs
index a7fde54f18..3a6ad54204 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Giphy.com the popular online GIFs and animated sticker provider.
///
-public class Giphy : OEmbedProviderBase
+public class Giphy : EmbedProviderBase
{
public Giphy(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs b/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs
index 85c1214fd1..87bc0524e4 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Hulu the the popular online subscription streaming service.
///
-public class Hulu : OEmbedProviderBase
+public class Hulu : EmbedProviderBase
{
public Hulu(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs b/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs
index 1a53ad88d1..7da51b51ad 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs
@@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Issuu the popular platform to create interactive flipbooks, social media posts, GIFs, and more from a single piece of static content.
///
-public class Issuu : OEmbedProviderBase
+public class Issuu : EmbedProviderBase
{
public Issuu(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs b/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs
index daf1cc25f9..fecfd8606b 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Kickstarter the popular online crowdfunding platform focused on creativity.
///
-public class Kickstarter : OEmbedProviderBase
+public class Kickstarter : EmbedProviderBase
{
public Kickstarter(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs b/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs
index 33802fa059..1791034168 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs
@@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for SlideShare for professional online content including presentations, infographics, documents, and videos.
///
-public class Slideshare : OEmbedProviderBase
+public class Slideshare : EmbedProviderBase
{
public Slideshare(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs b/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs
index 2d59031b63..ccb3104940 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs
@@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for SoundCloud the popular online audio distribution platform and music sharing provider.
///
-public class Soundcloud : OEmbedProviderBase
+public class Soundcloud : EmbedProviderBase
{
public Soundcloud(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Ted.cs b/src/Umbraco.Core/Media/EmbedProviders/Ted.cs
index 5fcc7fcb42..1e7981f7af 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Ted.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Ted.cs
@@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Ted that posts talks online for free distribution.
///
-public class Ted : OEmbedProviderBase
+public class Ted : EmbedProviderBase
{
public Ted(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs b/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs
index 81aeb36491..af2c723533 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Twitter the popular online service for microblogging and social networking.
///
-public class Twitter : OEmbedProviderBase
+public class Twitter : EmbedProviderBase
{
public Twitter(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs b/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs
index e4d19d463a..0159e59cbd 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs
@@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for Vimeo the popular online video hosting, sharing, and services platform provider.
///
-public class Vimeo : OEmbedProviderBase
+public class Vimeo : EmbedProviderBase
{
public Vimeo(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs b/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs
index 30cf2e6016..ceb8af99e9 100644
--- a/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs
+++ b/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders;
///
/// Embed Provider for YouTube the popular online video sharing and social media platform provider.
///
-public class YouTube : OEmbedProviderBase
+public class YouTube : EmbedProviderBase
{
public YouTube(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
diff --git a/src/Umbraco.Core/Models/ChangingPasswordModel.cs b/src/Umbraco.Core/Models/ChangingPasswordModel.cs
index ecba35f137..946bcde9ab 100644
--- a/src/Umbraco.Core/Models/ChangingPasswordModel.cs
+++ b/src/Umbraco.Core/Models/ChangingPasswordModel.cs
@@ -11,7 +11,7 @@ public class ChangingPasswordModel
/// The password value
///
[DataMember(Name = "newPassword")]
- public required string NewPassword { get; set; }
+ public string? NewPassword { get; set; }
///
/// The old password - used to change a password when: EnablePasswordRetrieval = false
diff --git a/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs b/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs
index 1e648f949f..1c04496e04 100644
--- a/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs
+++ b/src/Umbraco.Core/Models/ContentEditing/UserGroupPermissionsSave.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Umbraco.Extensions;
@@ -22,4 +22,13 @@ public class UserGroupPermissionsSave
///
[DataMember(Name = "permissions")]
public IDictionary> AssignedPermissions { get; set; }
+
+ [Obsolete("This is not used and will be removed in Umbraco 10")]
+ public IEnumerable Validate(ValidationContext validationContext)
+ {
+ if (AssignedPermissions.SelectMany(x => x.Value).Any(x => x.IsNullOrWhiteSpace()))
+ {
+ yield return new ValidationResult("A permission value cannot be null or empty", new[] { "Permissions" });
+ }
+ }
}
diff --git a/src/Umbraco.Core/Models/ContentType.cs b/src/Umbraco.Core/Models/ContentType.cs
index c31f5f72ff..f4fe617a83 100644
--- a/src/Umbraco.Core/Models/ContentType.cs
+++ b/src/Umbraco.Core/Models/ContentType.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.Models;
///
[Serializable]
[DataContract(IsReference = true)]
-public class ContentType : ContentTypeCompositionBase, IContentType
+public class ContentType : ContentTypeCompositionBase, IContentTypeWithHistoryCleanup
{
public const bool SupportsPublishingConst = true;
diff --git a/src/Umbraco.Core/Models/IContentType.cs b/src/Umbraco.Core/Models/IContentType.cs
index f43764faeb..5d76c49b88 100644
--- a/src/Umbraco.Core/Models/IContentType.cs
+++ b/src/Umbraco.Core/Models/IContentType.cs
@@ -2,6 +2,19 @@ using Umbraco.Cms.Core.Models.ContentEditing;
namespace Umbraco.Cms.Core.Models;
+///
+/// Defines a content type that contains a history cleanup policy.
+///
+[Obsolete("This will be merged into IContentType in Umbraco 10.")]
+public interface IContentTypeWithHistoryCleanup : IContentType
+{
+ ///
+ /// Gets or sets the history cleanup configuration.
+ ///
+ /// The history cleanup configuration.
+ HistoryCleanup? HistoryCleanup { get; set; }
+}
+
///
/// Defines a ContentType, which Content is based on
///
@@ -55,10 +68,4 @@ public interface IContentType : IContentTypeComposition
///
///
IContentType DeepCloneWithResetIdentities(string newAlias);
-
- ///
- /// Gets or sets the history cleanup configuration.
- ///
- /// The history cleanup configuration.
- HistoryCleanup? HistoryCleanup { get; set; }
}
diff --git a/src/Umbraco.Core/Models/Language.cs b/src/Umbraco.Core/Models/Language.cs
index 2072533917..9299665755 100644
--- a/src/Umbraco.Core/Models/Language.cs
+++ b/src/Umbraco.Core/Models/Language.cs
@@ -29,14 +29,22 @@ public class Language : EntityBase, ILanguage
_cultureName = cultureName ?? throw new ArgumentNullException(nameof(cultureName));
}
- ///
- [DataMember]
- public string IsoCode
+ [Obsolete(
+ "Use the constructor not requiring global settings and accepting an explicit name instead, scheduled for removal in V11.")]
+ public Language(GlobalSettings globalSettings, string isoCode)
+ {
+ _isoCode = isoCode ?? throw new ArgumentNullException(nameof(isoCode));
+ _cultureName = CultureInfo.GetCultureInfo(isoCode).EnglishName;
+ }
+
+ ///
+ [DataMember]
+ public string IsoCode
+ {
+ get => _isoCode;
+ set
{
- get => _isoCode;
- set
- {
- ArgumentNullException.ThrowIfNull(value);
+ ArgumentNullException.ThrowIfNull(value);
SetPropertyValueAndDetectChanges(value, ref _isoCode!, nameof(IsoCode));
}
diff --git a/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
index 5d35e3a32a..5829512648 100644
--- a/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
+++ b/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
@@ -1,4 +1,5 @@
using System.Globalization;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
@@ -9,6 +10,7 @@ using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
+using Umbraco.Cms.Web.Common.DependencyInjection;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.Models.Mapping;
@@ -32,12 +34,48 @@ public class ContentTypeMapDefinition : IMapDefinition
private readonly IShortStringHelper _shortStringHelper;
private ContentSettings _contentSettings;
- public ContentTypeMapDefinition(CommonMapper commonMapper, PropertyEditorCollection propertyEditors,
- IDataTypeService dataTypeService, IFileService fileService,
- IContentTypeService contentTypeService, IMediaTypeService mediaTypeService,
+ [Obsolete("Use ctor with all params injected")]
+ public ContentTypeMapDefinition(
+ CommonMapper commonMapper,
+ PropertyEditorCollection propertyEditors,
+ IDataTypeService dataTypeService,
+ IFileService fileService,
+ IContentTypeService contentTypeService,
+ IMediaTypeService mediaTypeService,
IMemberTypeService memberTypeService,
- ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper, IOptions globalSettings,
- IHostingEnvironment hostingEnvironment, IOptionsMonitor contentSettings)
+ ILoggerFactory loggerFactory,
+ IShortStringHelper shortStringHelper,
+ IOptions globalSettings,
+ IHostingEnvironment hostingEnvironment)
+ : this(
+ commonMapper,
+ propertyEditors,
+ dataTypeService,
+ fileService,
+ contentTypeService,
+ mediaTypeService,
+ memberTypeService,
+ loggerFactory,
+ shortStringHelper,
+ globalSettings,
+ hostingEnvironment,
+ StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+
+ public ContentTypeMapDefinition(
+ CommonMapper commonMapper,
+ PropertyEditorCollection propertyEditors,
+ IDataTypeService dataTypeService,
+ IFileService fileService,
+ IContentTypeService contentTypeService,
+ IMediaTypeService mediaTypeService,
+ IMemberTypeService memberTypeService,
+ ILoggerFactory loggerFactory,
+ IShortStringHelper shortStringHelper,
+ IOptions globalSettings,
+ IHostingEnvironment hostingEnvironment,
+ IOptionsMonitor contentSettings)
{
_commonMapper = commonMapper;
_propertyEditors = propertyEditors;
@@ -56,6 +94,32 @@ public class ContentTypeMapDefinition : IMapDefinition
contentSettings.OnChange(x => _contentSettings = x);
}
+ public static Udi? MapContentTypeUdi(IContentTypeComposition source)
+ {
+ if (source == null)
+ {
+ return null;
+ }
+
+ string udiType;
+ switch (source)
+ {
+ case IMemberType _:
+ udiType = Constants.UdiEntityType.MemberType;
+ break;
+ case IMediaType _:
+ udiType = Constants.UdiEntityType.MediaType;
+ break;
+ case IContentType _:
+ udiType = Constants.UdiEntityType.DocumentType;
+ break;
+ default:
+ throw new PanicException($"Source is of type {source.GetType()} which isn't supported here");
+ }
+
+ return Udi.Create(udiType, source.Key);
+ }
+
public void DefineMaps(IUmbracoMapper mapper)
{
mapper.Define(
@@ -107,52 +171,7 @@ public class ContentTypeMapDefinition : IMapDefinition
(source, context) => new MemberPropertyTypeDisplay(), Map);
}
- public static Udi? MapContentTypeUdi(IContentTypeComposition source)
- {
- if (source == null)
- {
- return null;
- }
-
- string udiType;
- switch (source)
- {
- case IMemberType _:
- udiType = Constants.UdiEntityType.MemberType;
- break;
- case IMediaType _:
- udiType = Constants.UdiEntityType.MediaType;
- break;
- case IContentType _:
- udiType = Constants.UdiEntityType.DocumentType;
- break;
- default:
- throw new PanicException($"Source is of type {source.GetType()} which isn't supported here");
- }
-
- return Udi.Create(udiType, source.Key);
- }
-
- // no MapAll - take care
- private void Map(DocumentTypeSave source, IContentType target, MapperContext context)
- {
- MapSaveToTypeBase(source, target, context);
- MapComposition(source, target, alias => _contentTypeService.Get(alias));
-
- MapHistoryCleanup(source, target);
-
- target.AllowedTemplates = source.AllowedTemplates?
- .Where(x => x != null)
- .Select(_fileService.GetTemplate)
- .WhereNotNull()
- .ToArray();
-
- target.SetDefaultTemplate(source.DefaultTemplate == null
- ? null
- : _fileService.GetTemplate(source.DefaultTemplate));
- }
-
- private static void MapHistoryCleanup(DocumentTypeSave source, IContentType target)
+ private static void MapHistoryCleanup(DocumentTypeSave source, IContentTypeWithHistoryCleanup target)
{
// If source history cleanup is null we don't have to map all properties
if (source.HistoryCleanup is null)
@@ -228,6 +247,28 @@ public class ContentTypeMapDefinition : IMapDefinition
target.SortOrder = source.SortOrder;
}
+ // no MapAll - take care
+ private void Map(DocumentTypeSave source, IContentType target, MapperContext context)
+ {
+ MapSaveToTypeBase(source, target, context);
+ MapComposition(source, target, alias => _contentTypeService.Get(alias));
+
+ if (target is IContentTypeWithHistoryCleanup targetWithHistoryCleanup)
+ {
+ MapHistoryCleanup(source, targetWithHistoryCleanup);
+ }
+
+ target.AllowedTemplates = source.AllowedTemplates?
+ .Where(x => x != null)
+ .Select(_fileService.GetTemplate)
+ .WhereNotNull()
+ .ToArray();
+
+ target.SetDefaultTemplate(source.DefaultTemplate == null
+ ? null
+ : _fileService.GetTemplate(source.DefaultTemplate));
+ }
+
// no MapAll - take care
private void Map(MediaTypeSave source, IMediaType target, MapperContext context)
{
@@ -262,7 +303,7 @@ public class ContentTypeMapDefinition : IMapDefinition
{
MapTypeToDisplayBase(source, target);
- if (source is IContentType sourceWithHistoryCleanup)
+ if (source is IContentTypeWithHistoryCleanup sourceWithHistoryCleanup)
{
target.HistoryCleanup = new HistoryCleanupViewModel
{
@@ -275,7 +316,7 @@ public class ContentTypeMapDefinition : IMapDefinition
_contentSettings.ContentVersionCleanupPolicy.KeepAllVersionsNewerThanDays,
GlobalKeepLatestVersionPerDayForDays =
_contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays,
- GlobalEnableCleanup = _contentSettings.ContentVersionCleanupPolicy.EnableCleanup
+ GlobalEnableCleanup = _contentSettings.ContentVersionCleanupPolicy.EnableCleanup,
};
}
@@ -454,8 +495,7 @@ public class ContentTypeMapDefinition : IMapDefinition
source, target, context);
// Umbraco.Code.MapAll -CreateDate -UpdateDate -DeleteDate -Key -PropertyTypes
- private static void Map(PropertyGroupBasic source, PropertyGroup target,
- MapperContext context)
+ private static void Map(PropertyGroupBasic source, PropertyGroup target, MapperContext context)
{
if (source.Id > 0)
{
@@ -896,8 +936,7 @@ public class ContentTypeMapDefinition : IMapDefinition
}
}
- private static void MapComposition(ContentTypeSave source, IContentTypeComposition target,
- Func getContentType)
+ private static void MapComposition(ContentTypeSave source, IContentTypeComposition target, Func getContentType)
{
var current = target.CompositionAliases().ToArray();
IEnumerable proposed = source.CompositeContentTypes;
diff --git a/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs b/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs
index 91bd8c3589..5441320b0f 100644
--- a/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs
+++ b/src/Umbraco.Core/Models/Mapping/ContentVariantMapper.cs
@@ -20,26 +20,8 @@ public class ContentVariantMapper
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
private readonly IContentService _contentService;
private readonly IUserService _userService;
- private ContentSettings _contentSettings;
+ private SecuritySettings _securitySettings;
- public ContentVariantMapper(
- ILocalizationService localizationService,
- ILocalizedTextService localizedTextService,
- IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
- IContentService contentService,
- IUserService userService,
- IOptionsMonitor contentSettings)
- {
- _localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
- _localizedTextService = localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
- _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
- _contentService = contentService;
- _userService = userService;
- _contentSettings = contentSettings.CurrentValue;
- contentSettings.OnChange(settings => _contentSettings = settings);
- }
-
- [Obsolete("Use constructor that takes all parameters instead")]
public ContentVariantMapper(
ILocalizationService localizationService,
ILocalizedTextService localizedTextService,
@@ -47,17 +29,16 @@ public class ContentVariantMapper
IContentService contentService,
IUserService userService,
IOptionsMonitor securitySettings)
- : this(
- localizationService,
- localizedTextService,
- backOfficeSecurityAccessor,
- contentService,
- userService,
- StaticServiceProvider.Instance.GetRequiredService>())
{
+ _localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
+ _localizedTextService = localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
+ _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
+ _contentService = contentService;
+ _userService = userService;
+ _securitySettings = securitySettings.CurrentValue;
+ securitySettings.OnChange(settings => _securitySettings = settings);
}
- [Obsolete("Use constructor that takes all parameters instead")]
public ContentVariantMapper(ILocalizationService localizationService, ILocalizedTextService localizedTextService)
: this(
localizationService,
@@ -263,7 +244,7 @@ public class ContentVariantMapper
if (variantDisplay.Language is null)
{
var defaultLanguageId = _localizationService.GetDefaultLanguageId();
- if (_contentSettings.AllowEditInvariantFromNonDefault || (defaultLanguageId.HasValue && group.HasAccessToLanguage(defaultLanguageId.Value)))
+ if (_securitySettings.AllowEditInvariantFromNonDefault || (defaultLanguageId.HasValue && group.HasAccessToLanguage(defaultLanguageId.Value)))
{
hasAccess = true;
}
diff --git a/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs
index 3c79d1c12f..cab595e00f 100644
--- a/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs
+++ b/src/Umbraco.Core/Models/Mapping/DictionaryMapDefinition.cs
@@ -1,8 +1,6 @@
-using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Services;
-using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Core.Models.Mapping;
@@ -15,6 +13,10 @@ public class DictionaryMapDefinition : IMapDefinition
private readonly CommonMapper? _commonMapper;
private readonly ILocalizationService _localizationService;
+ [Obsolete("Use the constructor with the CommonMapper")]
+ public DictionaryMapDefinition(ILocalizationService localizationService) =>
+ _localizationService = localizationService;
+
public DictionaryMapDefinition(ILocalizationService localizationService, CommonMapper commonMapper)
{
_localizationService = localizationService;
@@ -25,7 +27,9 @@ public class DictionaryMapDefinition : IMapDefinition
{
mapper.Define((source, context) => new EntityBasic(), Map);
mapper.Define((source, context) => new DictionaryDisplay(), Map);
- mapper.Define((source, context) => new DictionaryOverviewDisplay(), Map);
+ mapper.Define(
+ (source, context) => new DictionaryOverviewDisplay(),
+ Map);
}
// Umbraco.Code.MapAll -ParentId -Path -Trashed -Udi -Icon
diff --git a/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs b/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
index 65db6181dd..ae9876628f 100644
--- a/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
+++ b/src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
@@ -70,8 +70,7 @@ public class MemberTabsAndPropertiesMapper : TabsAndPropertiesMapper
return resolved;
}
- // We need this because we call GetCustomGenericProperties from TabsAndPropertiesMapper
- // and we have no access to MapMembershipProperties from the base class without casting
+ [Obsolete("Use MapMembershipProperties. Will be removed in Umbraco 10.")]
protected override IEnumerable GetCustomGenericProperties(IContentBase content)
{
var member = (IMember)content;
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
index aeee722ed2..bd5e7af0a4 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
@@ -56,6 +56,21 @@ namespace Umbraco.Cms.Core.Models.PublishedContent
InitializeIndexes();
}
+ [Obsolete("Use the overload specifying a key instead")]
+ public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable compositionAliases, IEnumerable propertyTypes, ContentVariation variations, bool isElement = false)
+ : this (Guid.Empty, id, alias, itemType, compositionAliases, variations, isElement)
+ {
+ PublishedPropertyType[] propertyTypesA = propertyTypes.ToArray();
+ foreach (PublishedPropertyType propertyType in propertyTypesA)
+ {
+ propertyType.ContentType = this;
+ }
+
+ _propertyTypes = propertyTypesA;
+
+ InitializeIndexes();
+ }
+
///
/// This constructor is for tests and is not intended to be used directly from application code.
///
@@ -70,6 +85,15 @@ namespace Umbraco.Cms.Core.Models.PublishedContent
InitializeIndexes();
}
+ [Obsolete("Use the overload specifying a key instead")]
+ public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable compositionAliases, Func> propertyTypes, ContentVariation variations, bool isElement = false)
+ : this(Guid.Empty, id, alias, itemType, compositionAliases, variations, isElement)
+ {
+ _propertyTypes = propertyTypes(this).ToArray();
+
+ InitializeIndexes();
+ }
+
private PublishedContentType(Guid key, int id, string alias, PublishedItemType itemType, IEnumerable compositionAliases, ContentVariation variations, bool isElement)
{
Key = key;
diff --git a/src/Umbraco.Core/Models/RelationType.cs b/src/Umbraco.Core/Models/RelationType.cs
index 519885b7fa..d48e802c6e 100644
--- a/src/Umbraco.Core/Models/RelationType.cs
+++ b/src/Umbraco.Core/Models/RelationType.cs
@@ -1,4 +1,4 @@
-using System.Runtime.Serialization;
+using System.Runtime.Serialization;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models;
@@ -22,7 +22,14 @@ public class RelationType : EntityBase, IRelationTypeWithIsDependency
{
}
- public RelationType(string? name, string? alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType, bool isDependency){
+ [Obsolete("Use ctor with isDependency parameter")]
+ public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType)
+ : this(name, alias, isBidrectional, parentObjectType, childObjectType, false)
+ {
+ }
+
+ public RelationType(string? name, string? alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType, bool isDependency)
+ {
if (name == null)
{
throw new ArgumentNullException(nameof(name));
diff --git a/src/Umbraco.Core/Models/SendCodeViewModel.cs b/src/Umbraco.Core/Models/SendCodeViewModel.cs
index 29d318f8ff..c73fd73eb3 100644
--- a/src/Umbraco.Core/Models/SendCodeViewModel.cs
+++ b/src/Umbraco.Core/Models/SendCodeViewModel.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models;
@@ -11,11 +11,11 @@ public class Verify2FACodeModel
{
[Required]
[DataMember(Name = "code", IsRequired = true)]
- public required string Code { get; set; }
+ public string? Code { get; set; }
[Required]
[DataMember(Name = "provider", IsRequired = true)]
- public required string Provider { get; set; }
+ public string? Provider { get; set; }
///
/// Flag indicating whether the sign-in cookie should persist after the browser is closed.
diff --git a/src/Umbraco.Core/Models/SetPasswordModel.cs b/src/Umbraco.Core/Models/SetPasswordModel.cs
index 58803c101d..57d1abc38f 100644
--- a/src/Umbraco.Core/Models/SetPasswordModel.cs
+++ b/src/Umbraco.Core/Models/SetPasswordModel.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models;
@@ -12,9 +12,9 @@ public class SetPasswordModel
[Required]
[DataMember(Name = "password", IsRequired = true)]
- public required string Password { get; set; }
+ public string? Password { get; set; }
[Required]
[DataMember(Name = "resetCode", IsRequired = true)]
- public required string ResetCode { get; set; }
+ public string? ResetCode { get; set; }
}
diff --git a/src/Umbraco.Core/Models/UnLinkLoginModel.cs b/src/Umbraco.Core/Models/UnLinkLoginModel.cs
index ba4d881b73..c121230810 100644
--- a/src/Umbraco.Core/Models/UnLinkLoginModel.cs
+++ b/src/Umbraco.Core/Models/UnLinkLoginModel.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models;
@@ -7,9 +7,9 @@ public class UnLinkLoginModel
{
[Required]
[DataMember(Name = "loginProvider", IsRequired = true)]
- public required string LoginProvider { get; set; }
+ public string? LoginProvider { get; set; }
[Required]
[DataMember(Name = "providerKey", IsRequired = true)]
- public required string ProviderKey { get; set; }
+ public string? ProviderKey { get; set; }
}
diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs
new file mode 100644
index 0000000000..036d5cf8a4
--- /dev/null
+++ b/src/Umbraco.Core/Notifications/UmbracoApplicationComponentsInstallingNotification.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Umbraco.
+// See LICENSE for more details.
+
+namespace Umbraco.Cms.Core.Notifications;
+
+// TODO (V10): Remove this class.
+
+///
+/// Notification that occurs during the Umbraco boot process, before instances of initialize.
+///
+[Obsolete(
+ "This notification was added to the core runtime start-up as a hook for Umbraco Cloud local connection string and database setup. " +
+ "Following re-work they are no longer used (from Deploy 9.2.0)." +
+ "Given they are non-documented and no other use is expected, they can be removed in the next major release")]
+public class UmbracoApplicationComponentsInstallingNotification : INotification
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The runtime level
+ public UmbracoApplicationComponentsInstallingNotification(RuntimeLevel runtimeLevel) => RuntimeLevel = runtimeLevel;
+
+ ///
+ /// Gets the runtime level of execution.
+ ///
+ public RuntimeLevel RuntimeLevel { get; }
+}
diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs
new file mode 100644
index 0000000000..2bbab6e7ec
--- /dev/null
+++ b/src/Umbraco.Core/Notifications/UmbracoApplicationMainDomAcquiredNotification.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Umbraco.
+// See LICENSE for more details.
+
+namespace Umbraco.Cms.Core.Notifications;
+
+// TODO (V10): Remove this class.
+
+///
+/// Notification that occurs during Umbraco boot after the MainDom has been acquired.
+///
+[Obsolete(
+ "This notification was added to the core runtime start-up as a hook for Umbraco Cloud local connection string and database setup. " +
+ "Following re-work they are no longer used (from Deploy 9.2.0)." +
+ "Given they are non-documented and no other use is expected, they can be removed in the next major release")]
+public class UmbracoApplicationMainDomAcquiredNotification : INotification
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public UmbracoApplicationMainDomAcquiredNotification()
+ {
+ }
+}
diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs
index 49eaac02f2..7c7e97f29f 100644
--- a/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs
+++ b/src/Umbraco.Core/Notifications/UmbracoApplicationStartingNotification.cs
@@ -2,21 +2,32 @@ namespace Umbraco.Cms.Core.Notifications;
///
/// Notification that occurs at the very end of the Umbraco boot process (after all s are
-/// initialized).
+/// initialized).
+///
+///
+public class UmbracoApplicationStartingNotification : IUmbracoApplicationLifetimeNotification
+{
+ ///
+ /// Initializes a new instance of the class.
///
- ///
- public class UmbracoApplicationStartingNotification : IUmbracoApplicationLifetimeNotification
+ /// The runtime level
+ [Obsolete("Use ctor with all params")]
+ public UmbracoApplicationStartingNotification(RuntimeLevel runtimeLevel)
+ : this(runtimeLevel, false)
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The runtime level
- /// Indicates whether Umbraco is restarting.
- public UmbracoApplicationStartingNotification(RuntimeLevel runtimeLevel, bool isRestarting)
- {
- RuntimeLevel = runtimeLevel;
- IsRestarting = isRestarting;
- }
+ // TODO: Remove this constructor in V10
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The runtime level
+ /// Indicates whether Umbraco is restarting.
+ public UmbracoApplicationStartingNotification(RuntimeLevel runtimeLevel, bool isRestarting)
+ {
+ RuntimeLevel = runtimeLevel;
+ IsRestarting = isRestarting;
+ }
///
/// Gets the runtime level.
diff --git a/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs b/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs
index 8face75954..a877bd3162 100644
--- a/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs
+++ b/src/Umbraco.Core/Notifications/UmbracoApplicationStoppingNotification.cs
@@ -1,17 +1,26 @@
namespace Umbraco.Cms.Core.Notifications;
+///
+/// Notification that occurs when Umbraco is shutting down (after all s are terminated).
+///
+///
+public class UmbracoApplicationStoppingNotification : IUmbracoApplicationLifetimeNotification
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ [Obsolete("Use ctor with all params")]
+ public UmbracoApplicationStoppingNotification()
+ : this(false)
+ {
+ // TODO: Remove this constructor in V10
+ }
///
- /// Notification that occurs when Umbraco is shutting down (after all s are terminated).
+ /// Initializes a new instance of the class.
///
- ///
- public class UmbracoApplicationStoppingNotification : IUmbracoApplicationLifetimeNotification
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// Indicates whether Umbraco is restarting.
- public UmbracoApplicationStoppingNotification(bool isRestarting) => IsRestarting = isRestarting;
+ /// Indicates whether Umbraco is restarting.
+ public UmbracoApplicationStoppingNotification(bool isRestarting) => IsRestarting = isRestarting;
///
public bool IsRestarting { get; }
diff --git a/src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs
new file mode 100644
index 0000000000..6d7370768c
--- /dev/null
+++ b/src/Umbraco.Core/Persistence/Repositories/IExternalLoginRepository.cs
@@ -0,0 +1,26 @@
+using Umbraco.Cms.Core.Security;
+
+namespace Umbraco.Cms.Core.Persistence.Repositories;
+
+public interface IExternalLoginRepository : IReadWriteQueryRepository,
+ IQueryRepository
+{
+ ///
+ /// Replaces all external login providers for the user
+ ///
+ ///
+ ///
+ [Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")]
+ void Save(int userId, IEnumerable logins);
+
+ ///
+ /// Replaces all external login provider tokens for the providers specified for the user
+ ///
+ ///
+ ///
+ [Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")]
+ void Save(int userId, IEnumerable tokens);
+
+ [Obsolete("Use method that takes guid as param from IExternalLoginWithKeyRepository")]
+ void DeleteUserLogins(int memberId);
+}
diff --git a/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs
index 136abec3c4..9d2fe0ecbf 100644
--- a/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/IMacroRepository.cs
@@ -1,11 +1,8 @@
-using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Persistence.Repositories;
public interface IMacroRepository : IReadWriteQueryRepository, IReadRepository
{
- IMacro? GetByAlias(string alias);
-
- IEnumerable GetAllByAlias(string[] aliases);
-
+ // IEnumerable GetAll(params string[] aliases);
}
diff --git a/src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs
new file mode 100644
index 0000000000..48ead78759
--- /dev/null
+++ b/src/Umbraco.Core/Persistence/Repositories/IMacroWithAliasRepository.cs
@@ -0,0 +1,11 @@
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.Persistence.Repositories;
+
+[Obsolete("This interface will be merged with IMacroRepository in Umbraco 11")]
+public interface IMacroWithAliasRepository : IMacroRepository
+{
+ IMacro? GetByAlias(string alias);
+
+ IEnumerable GetAllByAlias(string[] aliases);
+}
diff --git a/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs
index 32c04bdb4b..58475f802d 100644
--- a/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/IMemberRepository.cs
@@ -38,4 +38,20 @@ public interface IMemberRepository : IContentRepository
///
///
int GetCountByQuery(IQuery? query);
+
+ ///
+ /// Sets a members last login date based on their username
+ ///
+ ///
+ ///
+ ///
+ /// This is a specialized method because whenever a member logs in, the membership provider requires us to set the
+ /// 'online' which requires
+ /// updating their login date. This operation must be fast and cannot use database locks which is fine if we are only
+ /// executing a single query
+ /// for this data since there won't be any other data contention issues.
+ ///
+ [Obsolete(
+ "This is now a NoOp since last login date is no longer an umbraco property, set the date on the IMember directly and Save it instead, scheduled for removal in V11.")]
+ void SetLastLogin(string username, DateTime date);
}
diff --git a/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs
index 35458d6eba..893a3c248e 100644
--- a/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/IUserRepository.cs
@@ -1,4 +1,4 @@
-using System.Linq.Expressions;
+using System.Linq.Expressions;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Persistence.Querying;
@@ -13,6 +13,14 @@ public interface IUserRepository : IReadWriteQueryRepository
///
int GetCountByQuery(IQuery? query);
+ ///
+ /// Checks if a user with the username exists
+ ///
+ ///
+ ///
+ [Obsolete("This method will be removed in future versions. Please use ExistsByUserName instead.")]
+ bool Exists(string username);
+
///
/// Checks if a user with the username exists
///
diff --git a/src/Umbraco.Core/PropertyEditors/ContentPickerPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/ContentPickerPropertyEditor.cs
index 635b590ba4..6cd7645868 100644
--- a/src/Umbraco.Core/PropertyEditors/ContentPickerPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/ContentPickerPropertyEditor.cs
@@ -21,8 +21,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Content Picker",
"contentpicker",
ValueType = ValueTypes.String,
- Group = Constants.PropertyEditors.Groups.Pickers,
- ValueEditorIsReusable = true)]
+ Group = Constants.PropertyEditors.Groups.Pickers)]
public class ContentPickerPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Core/PropertyEditors/DataEditor.cs b/src/Umbraco.Core/PropertyEditors/DataEditor.cs
index 3009e8af62..b2b95f475b 100644
--- a/src/Umbraco.Core/PropertyEditors/DataEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/DataEditor.cs
@@ -20,8 +20,6 @@ namespace Umbraco.Cms.Core.PropertyEditors;
[DataContract]
public class DataEditor : IDataEditor
{
- private readonly bool _canReuseValueEditor;
- private IDataValueEditor? _reusableValueEditor;
private IDictionary? _defaultConfiguration;
///
@@ -50,8 +48,6 @@ public class DataEditor : IDataEditor
Icon = Attribute.Icon;
Group = Attribute.Group;
IsDeprecated = Attribute.IsDeprecated;
-
- _canReuseValueEditor = Attribute.ValueEditorIsReusable;
}
///
@@ -122,14 +118,18 @@ public class DataEditor : IDataEditor
/// instance is returned. Otherwise, a new instance is created by CreateValueEditor.
///
///
- /// The instance created by CreateValueEditor is cached if allowed by the DataEditor
- /// attribute ( == true).
+ /// The instance created by CreateValueEditor is not cached, i.e.
+ /// a new instance is created each time the property value is retrieved. The
+ /// property editor is a singleton, and the value editor cannot be a singleton
+ /// since it depends on the datatype configuration.
+ ///
+ ///
+ /// Technically, it could be cached by datatype but let's keep things
+ /// simple enough for now.
///
///
- public IDataValueEditor GetValueEditor() => ExplicitValueEditor
- ?? (_canReuseValueEditor
- ? _reusableValueEditor ??= CreateValueEditor()
- : CreateValueEditor());
+ // TODO: point of that one? shouldn't we always configure?
+ public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? CreateValueEditor();
///
///
diff --git a/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs b/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs
index d9164d07ab..ce15c66a80 100644
--- a/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs
+++ b/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs
@@ -178,10 +178,4 @@ public sealed class DataEditorAttribute : Attribute
///
/// A deprecated editor is still supported but not proposed in the UI.
public bool IsDeprecated { get; set; }
-
- ///
- /// Gets or sets a value indicating whether the value editor can be reused (cached).
- ///
- /// While most value editors can be reused, complex editors (e.g. block based editors) might not be applicable for reuse.
- public bool ValueEditorIsReusable { get; set; }
}
diff --git a/src/Umbraco.Core/PropertyEditors/DecimalPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/DecimalPropertyEditor.cs
index a6fa0633d7..a936a72512 100644
--- a/src/Umbraco.Core/PropertyEditors/DecimalPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/DecimalPropertyEditor.cs
@@ -11,8 +11,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
EditorType.PropertyValue | EditorType.MacroParameter,
"Decimal",
"decimal",
- ValueType = ValueTypes.Decimal,
- ValueEditorIsReusable = true)]
+ ValueType = ValueTypes.Decimal)]
public class DecimalPropertyEditor : DataEditor
{
///
diff --git a/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs
index c9e8545b68..12b1b2c8ef 100644
--- a/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs
@@ -11,8 +11,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Eye Dropper Color Picker",
"eyedropper",
Icon = "icon-colorpicker",
- Group = Constants.PropertyEditors.Groups.Pickers,
- ValueEditorIsReusable = true)]
+ Group = Constants.PropertyEditors.Groups.Pickers)]
public class EyeDropperColorPickerPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Core/PropertyEditors/IntegerPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/IntegerPropertyEditor.cs
index 6910912c51..a504c7df31 100644
--- a/src/Umbraco.Core/PropertyEditors/IntegerPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/IntegerPropertyEditor.cs
@@ -11,8 +11,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
EditorType.PropertyValue | EditorType.MacroParameter,
"Numeric",
"integer",
- ValueType = ValueTypes.Integer,
- ValueEditorIsReusable = true)]
+ ValueType = ValueTypes.Integer)]
public class IntegerPropertyEditor : DataEditor
{
public IntegerPropertyEditor(
diff --git a/src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs
index eb4c96552f..ae2f4c0897 100644
--- a/src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs
@@ -18,8 +18,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
Constants.PropertyEditors.Aliases.Label,
"Label",
"readonlyvalue",
- Icon = "icon-readonly",
- ValueEditorIsReusable = true)]
+ Icon = "icon-readonly")]
public class LabelPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Core/PropertyEditors/MarkdownPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/MarkdownPropertyEditor.cs
index 4bc17c8cfc..aa6e881aa2 100644
--- a/src/Umbraco.Core/PropertyEditors/MarkdownPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/MarkdownPropertyEditor.cs
@@ -17,8 +17,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"markdowneditor",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.RichContent,
- Icon = "icon-code",
- ValueEditorIsReusable = true)]
+ Icon = "icon-code")]
public class MarkdownPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Core/PropertyEditors/MemberGroupPickerPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/MemberGroupPickerPropertyEditor.cs
index dcb19624be..e839c0b527 100644
--- a/src/Umbraco.Core/PropertyEditors/MemberGroupPickerPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/MemberGroupPickerPropertyEditor.cs
@@ -6,8 +6,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"membergrouppicker",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.People,
- Icon = Constants.Icons.MemberGroup,
- ValueEditorIsReusable = true)]
+ Icon = Constants.Icons.MemberGroup)]
public class MemberGroupPickerPropertyEditor : DataEditor
{
public MemberGroupPickerPropertyEditor(
diff --git a/src/Umbraco.Core/PropertyEditors/MemberPickerPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/MemberPickerPropertyEditor.cs
index b16acaffb1..241736737e 100644
--- a/src/Umbraco.Core/PropertyEditors/MemberPickerPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/MemberPickerPropertyEditor.cs
@@ -6,8 +6,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"memberpicker",
ValueType = ValueTypes.String,
Group = Constants.PropertyEditors.Groups.People,
- Icon = Constants.Icons.Member,
- ValueEditorIsReusable = true)]
+ Icon = Constants.Icons.Member)]
public class MemberPickerPropertyEditor : DataEditor
{
public MemberPickerPropertyEditor(
diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs
index 2e26894d23..d73eb5a2eb 100644
--- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs
+++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs
@@ -1,4 +1,4 @@
-using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Cms.Core.PropertyEditors;
diff --git a/src/Umbraco.Core/PropertyEditors/UserPickerPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/UserPickerPropertyEditor.cs
index 79f9c6795b..20bc2eb120 100644
--- a/src/Umbraco.Core/PropertyEditors/UserPickerPropertyEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/UserPickerPropertyEditor.cs
@@ -6,8 +6,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"userpicker",
ValueType = ValueTypes.Integer,
Group = Constants.PropertyEditors.Groups.People,
- Icon = Constants.Icons.User,
- ValueEditorIsReusable = true)]
+ Icon = Constants.Icons.User)]
public class UserPickerPropertyEditor : DataEditor
{
public UserPickerPropertyEditor(
diff --git a/src/Umbraco.Core/Routing/DefaultUrlProvider.cs b/src/Umbraco.Core/Routing/DefaultUrlProvider.cs
index 6506d29725..d0a238dbb2 100644
--- a/src/Umbraco.Core/Routing/DefaultUrlProvider.cs
+++ b/src/Umbraco.Core/Routing/DefaultUrlProvider.cs
@@ -24,20 +24,37 @@ public class DefaultUrlProvider : IUrlProvider
private readonly UriUtility _uriUtility;
private RequestHandlerSettings _requestSettings;
- public DefaultUrlProvider(
- IOptionsMonitor requestSettings,
- ILogger logger,
- ISiteDomainMapper siteDomainMapper,
- IUmbracoContextAccessor umbracoContextAccessor,
- UriUtility uriUtility,
- ILocalizationService localizationService)
- {
- _requestSettings = requestSettings.CurrentValue;
- _logger = logger;
- _siteDomainMapper = siteDomainMapper;
- _umbracoContextAccessor = umbracoContextAccessor;
- _uriUtility = uriUtility;
- _localizationService = localizationService;
+ [Obsolete("Use ctor with all parameters")]
+ public DefaultUrlProvider(
+ IOptionsMonitor requestSettings,
+ ILogger logger,
+ ISiteDomainMapper siteDomainMapper,
+ IUmbracoContextAccessor umbracoContextAccessor,
+ UriUtility uriUtility)
+ : this(
+ requestSettings,
+ logger,
+ siteDomainMapper,
+ umbracoContextAccessor,
+ uriUtility,
+ StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
+ public DefaultUrlProvider(
+ IOptionsMonitor requestSettings,
+ ILogger logger,
+ ISiteDomainMapper siteDomainMapper,
+ IUmbracoContextAccessor umbracoContextAccessor,
+ UriUtility uriUtility,
+ ILocalizationService localizationService)
+ {
+ _requestSettings = requestSettings.CurrentValue;
+ _logger = logger;
+ _siteDomainMapper = siteDomainMapper;
+ _umbracoContextAccessor = umbracoContextAccessor;
+ _uriUtility = uriUtility;
+ _localizationService = localizationService;
requestSettings.OnChange(x => _requestSettings = x);
}
diff --git a/src/Umbraco.Core/Services/CultureImpactFactory.cs b/src/Umbraco.Core/Services/CultureImpactFactory.cs
index a05a030d1b..c520f95d0e 100644
--- a/src/Umbraco.Core/Services/CultureImpactFactory.cs
+++ b/src/Umbraco.Core/Services/CultureImpactFactory.cs
@@ -1,33 +1,25 @@
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Options;
+using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Models;
-using Umbraco.Cms.Web.Common.DependencyInjection;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.Services;
public class CultureImpactFactory : ICultureImpactFactory
{
- private ContentSettings _contentSettings;
+ private SecuritySettings _securitySettings;
- public CultureImpactFactory(IOptionsMonitor contentSettings)
- {
- _contentSettings = contentSettings.CurrentValue;
-
- contentSettings.OnChange(x => _contentSettings = x);
- }
-
- [Obsolete("Use constructor that takes IOptionsMonitor instead. Scheduled for removal in V12")]
public CultureImpactFactory(IOptionsMonitor securitySettings)
- : this(StaticServiceProvider.Instance.GetRequiredService>())
{
+ _securitySettings = securitySettings.CurrentValue;
+
+ securitySettings.OnChange(x => _securitySettings = x);
}
///
public CultureImpact? Create(string? culture, bool isDefault, IContent content)
{
- TryCreate(culture, isDefault, content.ContentType.Variations, true, _contentSettings.AllowEditInvariantFromNonDefault, out CultureImpact? impact);
+ TryCreate(culture, isDefault, content.ContentType.Variations, true, _securitySettings.AllowEditInvariantFromNonDefault, out CultureImpact? impact);
return impact;
}
@@ -56,7 +48,7 @@ public class CultureImpactFactory : ICultureImpactFactory
throw new ArgumentException("Culture \"*\" is not explicit.");
}
- return new CultureImpact(culture, isDefault, _contentSettings.AllowEditInvariantFromNonDefault);
+ return new CultureImpact(culture, isDefault, _securitySettings.AllowEditInvariantFromNonDefault);
}
///
diff --git a/src/Umbraco.Core/Services/EntityXmlSerializer.cs b/src/Umbraco.Core/Services/EntityXmlSerializer.cs
index 60ad1f10ba..0a744f3f0f 100644
--- a/src/Umbraco.Core/Services/EntityXmlSerializer.cs
+++ b/src/Umbraco.Core/Services/EntityXmlSerializer.cs
@@ -539,7 +539,7 @@ internal class EntityXmlSerializer : IEntityXmlSerializer
genericProperties,
tabs);
- if (contentType is IContentType withCleanup && withCleanup.HistoryCleanup is not null)
+ if (contentType is IContentTypeWithHistoryCleanup withCleanup && withCleanup.HistoryCleanup is not null)
{
xml.Add(SerializeCleanupPolicy(withCleanup.HistoryCleanup));
}
diff --git a/src/Umbraco.Core/Services/ExternalLoginService.cs b/src/Umbraco.Core/Services/ExternalLoginService.cs
index 061e0b93aa..677108dbcd 100644
--- a/src/Umbraco.Core/Services/ExternalLoginService.cs
+++ b/src/Umbraco.Core/Services/ExternalLoginService.cs
@@ -9,7 +9,7 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Core.Services;
-public class ExternalLoginService : RepositoryService, IExternalLoginWithKeyService
+public class ExternalLoginService : RepositoryService, IExternalLoginService, IExternalLoginWithKeyService
{
private readonly IExternalLoginWithKeyRepository _externalLoginRepository;
@@ -21,6 +21,37 @@ public class ExternalLoginService : RepositoryService, IExternalLoginWithKeyServ
: base(provider, loggerFactory, eventMessagesFactory) =>
_externalLoginRepository = externalLoginRepository;
+ [Obsolete("Use ctor injecting IExternalLoginWithKeyRepository")]
+ public ExternalLoginService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IExternalLoginRepository externalLoginRepository)
+ : this(provider, loggerFactory, eventMessagesFactory, StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
+ ///
+ [Obsolete("Use overload that takes a user/member key (Guid).")]
+ public IEnumerable GetExternalLogins(int userId)
+ => GetExternalLogins(userId.ToGuid());
+
+ ///
+ [Obsolete("Use overload that takes a user/member key (Guid).")]
+ public IEnumerable GetExternalLoginTokens(int userId) =>
+ GetExternalLoginTokens(userId.ToGuid());
+
+ ///
+ [Obsolete("Use overload that takes a user/member key (Guid).")]
+ public void Save(int userId, IEnumerable logins)
+ => Save(userId.ToGuid(), logins);
+
+ ///
+ [Obsolete("Use overload that takes a user/member key (Guid).")]
+ public void Save(int userId, IEnumerable tokens)
+ => Save(userId.ToGuid(), tokens);
+
+ ///
+ [Obsolete("Use overload that takes a user/member key (Guid).")]
+ public void DeleteUserLogins(int userId)
+ => DeleteUserLogins(userId.ToGuid());
+
public IEnumerable Find(string loginProvider, string providerKey)
{
using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true))
diff --git a/src/Umbraco.Core/Services/IExternalLoginService.cs b/src/Umbraco.Core/Services/IExternalLoginService.cs
new file mode 100644
index 0000000000..ba75d505ff
--- /dev/null
+++ b/src/Umbraco.Core/Services/IExternalLoginService.cs
@@ -0,0 +1,63 @@
+using Umbraco.Cms.Core.Security;
+
+namespace Umbraco.Cms.Core.Services;
+
+///
+/// Used to store the external login info
+///
+[Obsolete("Use IExternalLoginServiceWithKey. This will be removed in Umbraco 10")]
+public interface IExternalLoginService : IService
+{
+ ///
+ /// Returns all user logins assigned
+ ///
+ ///
+ ///
+ IEnumerable GetExternalLogins(int userId);
+
+ ///
+ /// Returns all user login tokens assigned
+ ///
+ ///
+ ///
+ IEnumerable GetExternalLoginTokens(int userId);
+
+ ///
+ /// Returns all logins matching the login info - generally there should only be one but in some cases
+ /// there might be more than one depending on if an administrator has been editing/removing members
+ ///
+ ///
+ ///
+ ///
+ IEnumerable Find(string loginProvider, string providerKey);
+
+ ///
+ /// Saves the external logins associated with the user
+ ///
+ ///
+ /// The user associated with the logins
+ ///
+ ///
+ ///
+ /// This will replace all external login provider information for the user
+ ///
+ void Save(int userId, IEnumerable logins);
+
+ ///
+ /// Saves the external login tokens associated with the user
+ ///
+ ///
+ /// The user associated with the tokens
+ ///
+ ///
+ ///
+ /// This will replace all external login tokens for the user
+ ///
+ void Save(int userId, IEnumerable tokens);
+
+ ///
+ /// Deletes all user logins - normally used when a member is deleted
+ ///
+ ///
+ void DeleteUserLogins(int userId);
+}
diff --git a/src/Umbraco.Core/Services/IMacroService.cs b/src/Umbraco.Core/Services/IMacroService.cs
index ef99248727..141b278d93 100644
--- a/src/Umbraco.Core/Services/IMacroService.cs
+++ b/src/Umbraco.Core/Services/IMacroService.cs
@@ -49,12 +49,5 @@ public interface IMacroService : IService
/////
///// Alias to retrieve an for
///// An object
- //IMacroPropertyType GetMacroPropertyTypeByAlias(string alias);
-
- ///
- /// Gets a list of available objects by alias.
- ///
- /// Optional array of aliases to limit the results
- /// An enumerable list of objects
- IEnumerable GetAll(params string[] aliases);
+ // IMacroPropertyType GetMacroPropertyTypeByAlias(string alias);
}
diff --git a/src/Umbraco.Core/Services/IMacroWithAliasService.cs b/src/Umbraco.Core/Services/IMacroWithAliasService.cs
new file mode 100644
index 0000000000..508168b877
--- /dev/null
+++ b/src/Umbraco.Core/Services/IMacroWithAliasService.cs
@@ -0,0 +1,14 @@
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.Services;
+
+[Obsolete("This interface will be merged with IMacroService in Umbraco 11")]
+public interface IMacroWithAliasService : IMacroService
+{
+ ///
+ /// Gets a list of available objects by alias.
+ ///
+ /// Optional array of aliases to limit the results
+ /// An enumerable list of objects
+ IEnumerable GetAll(params string[] aliases);
+}
diff --git a/src/Umbraco.Core/Services/IMembershipMemberService.cs b/src/Umbraco.Core/Services/IMembershipMemberService.cs
index 553441f572..dc96535f8b 100644
--- a/src/Umbraco.Core/Services/IMembershipMemberService.cs
+++ b/src/Umbraco.Core/Services/IMembershipMemberService.cs
@@ -128,6 +128,20 @@ public interface IMembershipMemberService : IService
/// or to Delete
void Delete(T membershipUser);
+ ///
+ /// Sets the last login date for the member if they are found by username
+ ///
+ ///
+ ///
+ ///
+ /// This is a specialized method because whenever a member logs in, the membership provider requires us to set the
+ /// 'online' which requires
+ /// updating their login date. This operation must be fast and cannot use database locks which is fine if we are only
+ /// executing a single query
+ /// for this data since there won't be any other data contention issues.
+ ///
+ void SetLastLogin(string username, DateTime date);
+
///
/// Saves an
///
diff --git a/src/Umbraco.Core/Services/ITwoFactorLoginService.cs b/src/Umbraco.Core/Services/ITwoFactorLoginService.cs
index 0a0cc751d5..d0509a9283 100644
--- a/src/Umbraco.Core/Services/ITwoFactorLoginService.cs
+++ b/src/Umbraco.Core/Services/ITwoFactorLoginService.cs
@@ -52,17 +52,15 @@ public interface ITwoFactorLoginService : IService
Task SaveAsync(TwoFactorLogin twoFactorLogin);
///
- /// Gets all the enabled 2FA providers for the user or member with the specified key.
+ /// Gets all the enabled 2FA providers for the user or member with the specified key.
///
Task> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey);
+}
- ///
- /// Disables 2FA with Code.
- ///
+[Obsolete("This will be merged into ITwoFactorLoginService in Umbraco 11")]
+public interface ITwoFactorLoginService2 : ITwoFactorLoginService
+{
Task DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code);
- ///
- /// Validates and Saves.
- ///
Task ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code);
}
diff --git a/src/Umbraco.Core/Services/LocalizedTextService.cs b/src/Umbraco.Core/Services/LocalizedTextService.cs
index 1634f60baa..839e52f49e 100644
--- a/src/Umbraco.Core/Services/LocalizedTextService.cs
+++ b/src/Umbraco.Core/Services/LocalizedTextService.cs
@@ -64,16 +64,27 @@ public class LocalizedTextService : ILocalizedTextService
XmlSourceToNoAreaDictionary(source));
}
- ///
- /// Initializes with a source of a dictionary of culture -> areas -> sub dictionary of keys/values
- ///
- ///
- ///
- public LocalizedTextService(
- IDictionary>>> source,
- ILogger logger)
- {
- IDictionary>>> dictionarySource =
+ [Obsolete(
+ "Use other ctor with IDictionary>>> as input parameter.")]
+ public LocalizedTextService(
+ IDictionary>> source,
+ ILogger logger)
+ : this(
+ source.ToDictionary(x => x.Key, x => new Lazy>>(() => x.Value)),
+ logger)
+ {
+ }
+
+ ///
+ /// Initializes with a source of a dictionary of culture -> areas -> sub dictionary of keys/values
+ ///
+ ///
+ ///
+ public LocalizedTextService(
+ IDictionary>>> source,
+ ILogger logger)
+ {
+ IDictionary>>> dictionarySource =
source ?? throw new ArgumentNullException(nameof(source));
_dictionarySourceLazy =
new Lazy>>>>(() =>
diff --git a/src/Umbraco.Core/Services/MacroService.cs b/src/Umbraco.Core/Services/MacroService.cs
index be07d1ef02..73889895e2 100644
--- a/src/Umbraco.Core/Services/MacroService.cs
+++ b/src/Umbraco.Core/Services/MacroService.cs
@@ -1,4 +1,4 @@
-using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Notifications;
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.Services;
///
/// Represents the Macro Service, which is an easy access to operations involving
///
-internal class MacroService : RepositoryService, IMacroService
+internal class MacroService : RepositoryService, IMacroWithAliasService
{
private readonly IAuditRepository _auditRepository;
private readonly IMacroRepository _macroRepository;
@@ -34,7 +34,7 @@ internal class MacroService : RepositoryService, IMacroService
/// An object
public IMacro? GetByAlias(string alias)
{
- if (_macroRepository is not IMacroRepository macroWithAliasRepository)
+ if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository)
{
return GetAll().FirstOrDefault(x => x.Alias == alias);
}
@@ -65,7 +65,7 @@ internal class MacroService : RepositoryService, IMacroService
public IEnumerable GetAll(params string[] aliases)
{
- if (_macroRepository is not IMacroRepository macroWithAliasRepository)
+ if (_macroRepository is not IMacroWithAliasRepository macroWithAliasRepository)
{
var hashset = new HashSet(aliases);
return GetAll().Where(x => hashset.Contains(x.Alias));
diff --git a/src/Umbraco.Core/Services/MemberService.cs b/src/Umbraco.Core/Services/MemberService.cs
index d8f9f787aa..76d730dc78 100644
--- a/src/Umbraco.Core/Services/MemberService.cs
+++ b/src/Umbraco.Core/Services/MemberService.cs
@@ -728,7 +728,11 @@ namespace Umbraco.Cms.Core.Services
#region Save
- public void SetLastLogin(string username, DateTime date) => throw new NotImplementedException();
+ ///
+ [Obsolete("This is now a NoOp since last login date is no longer an umbraco property, set the date on the IMember directly and Save it instead, scheduled for removal in V11.")]
+ public void SetLastLogin(string username, DateTime date)
+ {
+ }
///
public void Save(IMember member)
diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs
index 9def2bd8fa..0e24f27be5 100644
--- a/src/Umbraco.Core/Services/ServiceContext.cs
+++ b/src/Umbraco.Core/Services/ServiceContext.cs
@@ -1,4 +1,4 @@
-namespace Umbraco.Cms.Core.Services;
+namespace Umbraco.Cms.Core.Services;
///
/// Represents the Umbraco Service context, which provides access to all services.
@@ -13,7 +13,7 @@ public class ServiceContext
private readonly Lazy? _dataTypeService;
private readonly Lazy? _domainService;
private readonly Lazy? _entityService;
- private readonly Lazy? _externalLoginService;
+ private readonly Lazy? _externalLoginService;
private readonly Lazy? _fileService;
private readonly Lazy? _keyValueService;
private readonly Lazy? _localizationService;
@@ -59,7 +59,7 @@ public class ServiceContext
Lazy? memberTypeService,
Lazy? memberGroupService,
Lazy? notificationService,
- Lazy? externalLoginService,
+ Lazy? externalLoginService,
Lazy? redirectUrlService,
Lazy? consentService,
Lazy? keyValueService,
@@ -207,7 +207,7 @@ public class ServiceContext
///
/// Gets the ExternalLoginService.
///
- public IExternalLoginWithKeyService? ExternalLoginService => _externalLoginService?.Value;
+ public IExternalLoginService? ExternalLoginService => _externalLoginService?.Value;
///
/// Gets the RedirectUrlService.
@@ -257,7 +257,7 @@ public class ServiceContext
IDomainService? domainService = null,
IMacroService? macroService = null,
IPublicAccessService? publicAccessService = null,
- IExternalLoginWithKeyService? externalLoginService = null,
+ IExternalLoginService? externalLoginService = null,
IServerRegistrationService? serverRegistrationService = null,
IRedirectUrlService? redirectUrlService = null,
IConsentService? consentService = null,
diff --git a/src/Umbraco.Core/Services/TwoFactorLoginService.cs b/src/Umbraco.Core/Services/TwoFactorLoginService.cs
index acbdded1c9..de79284ac9 100644
--- a/src/Umbraco.Core/Services/TwoFactorLoginService.cs
+++ b/src/Umbraco.Core/Services/TwoFactorLoginService.cs
@@ -11,7 +11,7 @@ using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Core.Services;
///
-public class TwoFactorLoginService : ITwoFactorLoginService
+public class TwoFactorLoginService : ITwoFactorLoginService2
{
private readonly IOptions _backOfficeIdentityOptions;
private readonly IOptions _identityOptions;
@@ -39,6 +39,23 @@ public class TwoFactorLoginService : ITwoFactorLoginService
_twoFactorSetupGenerators = twoFactorSetupGenerators.ToDictionary(x => x.ProviderName);
}
+ [Obsolete("Use ctor with all params - This will be removed in v11")]
+ public TwoFactorLoginService(
+ ITwoFactorLoginRepository twoFactorLoginRepository,
+ ICoreScopeProvider scopeProvider,
+ IEnumerable twoFactorSetupGenerators,
+ IOptions identityOptions,
+ IOptions backOfficeIdentityOptions)
+ : this(
+ twoFactorLoginRepository,
+ scopeProvider,
+ twoFactorSetupGenerators,
+ identityOptions,
+ backOfficeIdentityOptions,
+ StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+
///
public async Task DeleteUserLoginsAsync(Guid userOrMemberKey)
{
diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs
index 69e6351fbd..88e2708b2c 100644
--- a/src/Umbraco.Core/Services/UserService.cs
+++ b/src/Umbraco.Core/Services/UserService.cs
@@ -333,8 +333,13 @@ internal class UserService : RepositoryService, IUserService
}
}
+ // explicit implementation because we don't need it now but due to the way that the members membership provider is put together
+ // this method must exist in this service as an implementation (legacy)
+ void IMembershipMemberService.SetLastLogin(string username, DateTime date) => _logger.LogWarning(
+ "This method is not implemented. Using membership providers users is not advised, use ASP.NET Identity instead. See issue #9224 for more information.");
+
///
- /// Saves an
+ /// Saves an
///
/// to Save
public void Save(IUser entity)
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index 8ee0b780b0..01183739d5 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
Umbraco.Cms.Core
Umbraco CMS
Umbraco.Cms.Core
@@ -15,15 +15,6 @@
-
-
-
-
-
-
-
-
-
@@ -39,7 +30,7 @@
-
+
all
diff --git a/src/Umbraco.Core/Web/IRequestAccessor.cs b/src/Umbraco.Core/Web/IRequestAccessor.cs
index 57940b3c1b..a72ec5bc72 100644
--- a/src/Umbraco.Core/Web/IRequestAccessor.cs
+++ b/src/Umbraco.Core/Web/IRequestAccessor.cs
@@ -5,12 +5,12 @@ public interface IRequestAccessor
///
/// Returns the request/form/querystring value for the given name
///
- string? GetRequestValue(string name);
+ string GetRequestValue(string name);
///
/// Returns the query string value for the given name
///
- string? GetQueryStringValue(string name);
+ string GetQueryStringValue(string name);
///
/// Returns the current request uri
diff --git a/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs b/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs
index 813618738b..c6116e122f 100644
--- a/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs
+++ b/src/Umbraco.Core/WebAssets/IRuntimeMinifier.cs
@@ -1,34 +1,34 @@
namespace Umbraco.Cms.Core.WebAssets;
///
-/// Used for bundling and minifying web assets at runtime
+/// Used for bundling and minifying web assets at runtime
///
public interface IRuntimeMinifier
{
///
- /// Returns the cache buster value
+ /// Returns the cache buster value
///
string CacheBuster { get; }
///
- /// Creates a css bundle
+ /// Creates a css bundle
///
///
///
///
- /// All files must be absolute paths, relative paths will throw
+ /// All files must be absolute paths, relative paths will throw
///
///
- /// Thrown if any of the paths specified are not absolute
+ /// Thrown if any of the paths specified are not absolute
///
void CreateCssBundle(string bundleName, BundlingOptions bundleOptions, params string[]? filePaths);
///
- /// Renders the html link tag for the bundle
+ /// Renders the html link tag for the bundle
///
///
///
- /// An html encoded string
+ /// An html encoded string
///
Task RenderCssHereAsync(string bundleName);
@@ -39,45 +39,63 @@ public interface IRuntimeMinifier
///
///
///
- /// All files must be absolute paths, relative paths will throw
+ /// All files must be absolute paths, relative paths will throw
///
///
- /// Thrown if any of the paths specified are not absolute
+ /// Thrown if any of the paths specified are not absolute
///
void CreateJsBundle(string bundleName, BundlingOptions bundleOptions, params string[]? filePaths);
///
- /// Renders the html script tag for the bundle
+ /// Renders the html script tag for the bundle
///
///
///
- /// An html encoded string
+ /// An html encoded string
///
Task RenderJsHereAsync(string bundleName);
///
- /// Returns the asset paths for the JS bundle name
+ /// Returns the asset paths for the JS bundle name
///
///
///
- /// If debug mode is enabled this will return all asset paths (not bundled), else it will return a bundle URL
+ /// If debug mode is enabled this will return all asset paths (not bundled), else it will return a bundle URL
///
Task> GetJsAssetPathsAsync(string bundleName);
///
- /// Returns the asset paths for the css bundle name
+ /// Returns the asset paths for the css bundle name
///
///
///
- /// If debug mode is enabled this will return all asset paths (not bundled), else it will return a bundle URL
+ /// If debug mode is enabled this will return all asset paths (not bundled), else it will return a bundle URL
///
Task> GetCssAssetPathsAsync(string bundleName);
///
- /// Minify the file content, of a given type
+ /// Minify the file content, of a given type
///
///
///
///
Task MinifyAsync(string? fileContent, AssetType assetType);
+
+ ///
+ /// Ensures that all runtime minifications are refreshed on next request. E.g. Clearing cache.
+ ///
+ ///
+ ///
+ /// No longer necessary, invalidation occurs automatically if any of the following occur.
+ ///
+ ///
+ /// - Your sites assembly information version changes.
+ /// - Umbraco.Cms.Core assembly information version changes.
+ /// - RuntimeMinificationSettings Version string changes.
+ ///
+ /// for further
+ /// details.
+ ///
+ [Obsolete("Invalidation is handled automatically. Scheduled for removal V11.")]
+ void Reset();
}
diff --git a/src/Umbraco.Examine.Lucene/DependencyInjection/ConfigureIndexOptions.cs b/src/Umbraco.Examine.Lucene/DependencyInjection/ConfigureIndexOptions.cs
index f7c3cf9a3e..e6306ab444 100644
--- a/src/Umbraco.Examine.Lucene/DependencyInjection/ConfigureIndexOptions.cs
+++ b/src/Umbraco.Examine.Lucene/DependencyInjection/ConfigureIndexOptions.cs
@@ -25,7 +25,7 @@ public sealed class ConfigureIndexOptions : IConfigureNamedOptions
- net7.0
+ net6.0
Umbraco.Cms.Infrastructure.Examine
Umbraco CMS
Umbraco.Examine.Lucene
@@ -21,7 +21,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs b/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs
index 1e17b959b6..6d583151ba 100644
--- a/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs
+++ b/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs
@@ -19,6 +19,11 @@ namespace Umbraco.Cms.Core.Configuration
private readonly ILogger _logger;
private readonly object _locker = new object();
+ [Obsolete]
+ public JsonConfigManipulator(IConfiguration configuration)
+ : this(configuration, StaticServiceProvider.Instance.GetRequiredService>())
+ { }
+
public JsonConfigManipulator(IConfiguration configuration, ILogger logger)
{
_configuration = configuration;
@@ -229,7 +234,7 @@ namespace Umbraco.Cms.Core.Configuration
{
if (provider.Source.FileProvider is PhysicalFileProvider physicalFileProvider)
{
- var jsonFilePath = Path.Combine(physicalFileProvider.Root, provider.Source.Path!);
+ var jsonFilePath = Path.Combine(physicalFileProvider.Root, provider.Source.Path);
try
{
@@ -264,7 +269,7 @@ namespace Umbraco.Cms.Core.Configuration
return null;
}
- var jsonFilePath = Path.Combine(physicalFileProvider.Root, provider.Source.Path!);
+ var jsonFilePath = Path.Combine(physicalFileProvider.Root, provider.Source.Path);
try
{
diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs
index 3afb9fe64a..8b20a4725a 100644
--- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs
+++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Repositories.cs
@@ -32,7 +32,8 @@ public static partial class UmbracoBuilderExtensions
builder.Services.AddUnique();
builder.Services.AddMultipleUnique();
builder.Services.AddUnique();
- builder.Services.AddSingleton();
+ builder.Services.AddUnique();
+ builder.Services.AddUnique(factory => factory.GetRequiredService());
builder.Services.AddUnique(factory => factory.GetRequiredService());
builder.Services.AddUnique();
builder.Services.AddUnique();
diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
index dd5b77abec..b7d600ec7c 100644
--- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
+++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
@@ -57,7 +57,7 @@ public static partial class UmbracoBuilderExtensions
builder.Services.AddTransient();
builder.Services.AddUnique();
builder.Services.AddTransient();
- builder.Services.AddSingleton();
+ builder.Services.AddTransient();
return builder;
}
diff --git a/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs b/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs
index a08c5f1b59..68b311f8cd 100644
--- a/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs
+++ b/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs
@@ -45,6 +45,13 @@ public abstract class RecurringHostedServiceBase : IHostedService, IDisposable
_delay = delay;
}
+ // Scheduled for removal in V11
+ [Obsolete("Please use constructor that takes an ILogger instead")]
+ protected RecurringHostedServiceBase(TimeSpan period, TimeSpan delay)
+ : this(null, period, delay)
+ {
+ }
+
///
public void Dispose()
{
diff --git a/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs b/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs
index d4a6265052..bd69c7857c 100644
--- a/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs
+++ b/src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs
@@ -40,11 +40,21 @@ public class ReportSiteTask : RecurringHostedServiceBase
{
}
- ///
- /// Runs the background task to send the anonymous ID
- /// to telemetry service
- ///
- public override async Task PerformExecuteAsync(object? state){
+ [Obsolete("Use the constructor that takes ITelemetryService instead, scheduled for removal in V11")]
+ public ReportSiteTask(
+ ILogger logger,
+ IUmbracoVersion umbracoVersion,
+ IOptions globalSettings)
+ : this(logger, StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
+ ///
+ /// Runs the background task to send the anonymous ID
+ /// to telemetry service
+ ///
+ public override async Task PerformExecuteAsync(object? state)
+ {
if (_runtimeState.Level is not RuntimeLevel.Run)
{
// We probably haven't installed yet, so we can't get telemetry.
diff --git a/src/Umbraco.Infrastructure/Logging/Serilog/Enrichers/ThreadAbortExceptionEnricher.cs b/src/Umbraco.Infrastructure/Logging/Serilog/Enrichers/ThreadAbortExceptionEnricher.cs
index 4083aa7311..45495de9e8 100644
--- a/src/Umbraco.Infrastructure/Logging/Serilog/Enrichers/ThreadAbortExceptionEnricher.cs
+++ b/src/Umbraco.Infrastructure/Logging/Serilog/Enrichers/ThreadAbortExceptionEnricher.cs
@@ -38,9 +38,9 @@ public class ThreadAbortExceptionEnricher : ILogEventEnricher
}
}
- private static bool IsTimeoutThreadAbortException(Exception? exception)
+ private static bool IsTimeoutThreadAbortException(Exception exception)
{
- if (exception is null || !(exception is ThreadAbortException abort))
+ if (!(exception is ThreadAbortException abort))
{
return false;
}
@@ -76,7 +76,7 @@ public class ThreadAbortExceptionEnricher : ILogEventEnricher
// dump if configured, or if stacktrace contains Monitor.ReliableEnter
var dump = _coreDebugSettings.DumpOnTimeoutThreadAbort ||
- IsMonitorEnterThreadAbortException(logEvent.Exception!);
+ IsMonitorEnterThreadAbortException(logEvent.Exception);
// dump if it is ok to dump (might have a cap on number of dump...)
dump &= MiniDump.OkToDump(_hostingEnvironment);
diff --git a/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs b/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs
index 3fc763d92f..df1457d419 100644
--- a/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs
+++ b/src/Umbraco.Infrastructure/Logging/Viewer/ILogViewer.cs
@@ -1,4 +1,4 @@
-using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Logging.Viewer;
@@ -39,6 +39,13 @@ public interface ILogViewer
bool CheckCanOpenLogs(LogTimePeriod logTimePeriod);
+ ///
+ /// Gets the current Serilog minimum log level
+ ///
+ ///
+ [Obsolete("Please use GetLogLevels() instead. Scheduled for removal in V11.")]
+ string GetLogLevel();
+
///
/// Returns the collection of logs
///
diff --git a/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs
index 56efba4ca9..9dae731af3 100644
--- a/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs
+++ b/src/Umbraco.Infrastructure/Logging/Viewer/SerilogLogViewerSourceBase.cs
@@ -1,4 +1,4 @@
-using System.Collections.ObjectModel;
+using System.Collections.ObjectModel;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
using Serilog.Events;
@@ -14,6 +14,14 @@ public abstract class SerilogLogViewerSourceBase : ILogViewer
private readonly ILogViewerConfig _logViewerConfig;
private readonly ILogger _serilogLog;
+ [Obsolete("Please use ctor with all params instead. Scheduled for removal in V11.")]
+ protected SerilogLogViewerSourceBase(ILogViewerConfig logViewerConfig, ILogger serilogLog)
+ {
+ _logViewerConfig = logViewerConfig;
+ _logLevelLoader = StaticServiceProvider.Instance.GetRequiredService();
+ _serilogLog = serilogLog;
+ }
+
protected SerilogLogViewerSourceBase(ILogViewerConfig logViewerConfig, ILogLevelLoader logLevelLoader, ILogger serilogLog)
{
_logViewerConfig = logViewerConfig;
@@ -41,6 +49,17 @@ public abstract class SerilogLogViewerSourceBase : ILogViewer
return errorCounter.Count;
}
+ ///
+ /// Get the Serilog minimum-level value from the config file.
+ ///
+ [Obsolete("Please use LogLevelLoader.GetGlobalMinLogLevel() instead. Scheduled for removal in V11.")]
+ public string GetLogLevel()
+ {
+ LogEventLevel? logLevel = Enum.GetValues(typeof(LogEventLevel)).Cast()
+ .Where(_serilogLog.IsEnabled).DefaultIfEmpty(LogEventLevel.Information).Min();
+ return logLevel?.ToString() ?? string.Empty;
+ }
+
public LogLevelCounts GetLogLevelCounts(LogTimePeriod logTimePeriod)
{
var counter = new CountingFilter();
diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Alter/Table/AlterTableBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Alter/Table/AlterTableBuilder.cs
index b4f7b12563..fd9dee6745 100644
--- a/src/Umbraco.Infrastructure/Migrations/Expressions/Alter/Table/AlterTableBuilder.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Expressions/Alter/Table/AlterTableBuilder.cs
@@ -26,7 +26,7 @@ public class AlterTableBuilder : ExpressionBuilderBase logger,
- ILoggerFactory loggerFactory,
- IUmbracoVersion umbracoVersion,
- IEventAggregator eventAggregator,
- IOptionsMonitor defaultDataCreationSettings)
- {
- _database = database ?? throw new ArgumentNullException(nameof(database));
- _logger = logger ?? throw new ArgumentNullException(nameof(logger));
- _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
- _umbracoVersion = umbracoVersion ?? throw new ArgumentNullException(nameof(umbracoVersion));
- _eventAggregator = eventAggregator;
- _defaultDataCreationSettings = defaultDataCreationSettings;
+ [Obsolete("Please use constructor taking all parameters. Scheduled for removal in V11.")]
+ public DatabaseSchemaCreator(
+ IUmbracoDatabase? database,
+ ILogger logger,
+ ILoggerFactory loggerFactory,
+ IUmbracoVersion umbracoVersion,
+ IEventAggregator eventAggregator)
+ : this(database, logger, loggerFactory, umbracoVersion, eventAggregator,
+ StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+
+ public DatabaseSchemaCreator(
+ IUmbracoDatabase? database,
+ ILogger logger,
+ ILoggerFactory loggerFactory,
+ IUmbracoVersion umbracoVersion,
+ IEventAggregator eventAggregator,
+ IOptionsMonitor defaultDataCreationSettings)
+ {
+ _database = database ?? throw new ArgumentNullException(nameof(database));
+ _logger = logger ?? throw new ArgumentNullException(nameof(logger));
+ _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
+ _umbracoVersion = umbracoVersion ?? throw new ArgumentNullException(nameof(umbracoVersion));
+ _eventAggregator = eventAggregator;
+ _defaultDataCreationSettings = defaultDataCreationSettings;
if (_database?.SqlContext?.SqlSyntax == null)
{
diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs
index 860ed870f7..6c28f08eb6 100644
--- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreatorFactory.cs
@@ -1,9 +1,11 @@
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Infrastructure.Persistence;
+using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Infrastructure.Migrations.Install;
@@ -18,19 +20,30 @@ public class DatabaseSchemaCreatorFactory
private readonly ILoggerFactory _loggerFactory;
private readonly IUmbracoVersion _umbracoVersion;
- public DatabaseSchemaCreatorFactory(
- ILogger logger,
- ILoggerFactory loggerFactory,
- IUmbracoVersion umbracoVersion,
- IEventAggregator eventAggregator,
- IOptionsMonitor installDefaultDataSettings)
- {
- _logger = logger;
- _loggerFactory = loggerFactory;
- _umbracoVersion = umbracoVersion;
- _eventAggregator = eventAggregator;
- _installDefaultDataSettings = installDefaultDataSettings;
- }
+ [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in V11.")]
+ public DatabaseSchemaCreatorFactory(
+ ILogger logger,
+ ILoggerFactory loggerFactory,
+ IUmbracoVersion umbracoVersion,
+ IEventAggregator eventAggregator)
+ : this(logger, loggerFactory, umbracoVersion, eventAggregator,
+ StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+
+ public DatabaseSchemaCreatorFactory(
+ ILogger logger,
+ ILoggerFactory loggerFactory,
+ IUmbracoVersion umbracoVersion,
+ IEventAggregator eventAggregator,
+ IOptionsMonitor installDefaultDataSettings)
+ {
+ _logger = logger;
+ _loggerFactory = loggerFactory;
+ _umbracoVersion = umbracoVersion;
+ _eventAggregator = eventAggregator;
+ _installDefaultDataSettings = installDefaultDataSettings;
+ }
public DatabaseSchemaCreator Create(IUmbracoDatabase? database) => new DatabaseSchemaCreator(database, _logger,
_loggerFactory, _umbracoVersion, _eventAggregator, _installDefaultDataSettings);
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs
index f1369db5c3..6e5e462d8d 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs
@@ -84,9 +84,17 @@ public class AddTypedLabels : MigrationBase
.From()
.Where(x => x.DataTypeId == Constants.DataTypes.LabelString));
- var intPropertyAliases = new[] { Cms.Core.Constants.Conventions.Media.Width, Cms.Core.Constants.Conventions.Media.Height, "umbracoMemberFailedPasswordAttempts" };
- var bigintPropertyAliases = new[] { Cms.Core.Constants.Conventions.Media.Bytes };
- var dtPropertyAliases = new[] { "umbracoMemberLastLockoutDate", "umbracoMemberLastLogin", "umbracoMemberLastPasswordChangeDate" };
+ var intPropertyAliases = new[]
+ {
+ Constants.Conventions.Media.Width, Constants.Conventions.Media.Height,
+ Constants.Conventions.Member.FailedPasswordAttempts,
+ };
+ var bigintPropertyAliases = new[] { Constants.Conventions.Media.Bytes };
+ var dtPropertyAliases = new[]
+ {
+ Constants.Conventions.Member.LastLockoutDate, Constants.Conventions.Member.LastLoginDate,
+ Constants.Conventions.Member.LastPasswordChangeDate,
+ };
var intPropertyTypes = labelPropertyTypes.Where(pt => intPropertyAliases.Contains(pt.Alias)).Select(pt => pt.Id)
.ToArray();
diff --git a/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs b/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs
index 3e3c2cfae1..cec42492a3 100644
--- a/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs
+++ b/src/Umbraco.Infrastructure/Packaging/AutomaticPackageMigrationPlan.cs
@@ -1,5 +1,3 @@
-using Microsoft.Extensions.Options;
-using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Packaging;
using Umbraco.Cms.Core.PropertyEditors;
@@ -44,8 +42,8 @@ public abstract class AutomaticPackageMigrationPlan : PackageMigrationPlan
MediaUrlGeneratorCollection mediaUrlGenerators,
IShortStringHelper shortStringHelper,
IContentTypeBaseServiceProvider contentTypeBaseServiceProvider,
- IMigrationContext context, IOptions options)
- : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context, options)
+ IMigrationContext context)
+ : base(packagingService, mediaService, mediaFileManager, mediaUrlGenerators, shortStringHelper, contentTypeBaseServiceProvider, context)
{
}
diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
index 192d1a51c3..b4f49ab76b 100644
--- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
+++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
@@ -906,7 +906,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging
UpdateContentTypesPropertyGroups(contentType, documentType.Element("Tabs"));
UpdateContentTypesProperties(contentType, documentType.Element("GenericProperties"));
- if (contentType is IContentType withCleanup)
+ if (contentType is IContentTypeWithHistoryCleanup withCleanup)
{
UpdateHistoryCleanupPolicy(withCleanup, documentType.Element("HistoryCleanupPolicy"));
}
@@ -914,7 +914,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging
return contentType;
}
- private void UpdateHistoryCleanupPolicy(IContentType withCleanup, XElement? element)
+ private void UpdateHistoryCleanupPolicy(IContentTypeWithHistoryCleanup withCleanup, XElement? element)
{
if (element == null)
{
diff --git a/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs b/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs
index 6f0355f674..ae739c4361 100644
--- a/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs
+++ b/src/Umbraco.Infrastructure/Packaging/PackageMigrationBase.cs
@@ -1,3 +1,5 @@
+using System.ComponentModel;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.IO;
@@ -5,6 +7,7 @@ using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
using Umbraco.Cms.Infrastructure.Migrations;
+using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Infrastructure.Packaging;
@@ -38,16 +41,36 @@ public abstract class PackageMigrationBase : MigrationBase
_packageMigrationsSettings = packageMigrationsSettings;
}
- public IImportPackageBuilder ImportPackage => BeginBuild(
- new ImportPackageBuilder(
- _packagingService,
- _mediaService,
- _mediaFileManager,
- _mediaUrlGenerators,
- _shortStringHelper,
- _contentTypeBaseServiceProvider,
- Context,
- _packageMigrationsSettings));
-
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete("Use ctor with all params")]
+ public PackageMigrationBase(
+ IPackagingService packagingService,
+ IMediaService mediaService,
+ MediaFileManager mediaFileManager,
+ MediaUrlGeneratorCollection mediaUrlGenerators,
+ IShortStringHelper shortStringHelper,
+ IContentTypeBaseServiceProvider contentTypeBaseServiceProvider,
+ IMigrationContext context)
+ : this(
+ packagingService,
+ mediaService,
+ mediaFileManager,
+ mediaUrlGenerators,
+ shortStringHelper,
+ contentTypeBaseServiceProvider,
+ context,
+ StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+ public IImportPackageBuilder ImportPackage => BeginBuild(
+ new ImportPackageBuilder(
+ _packagingService,
+ _mediaService,
+ _mediaFileManager,
+ _mediaUrlGenerators,
+ _shortStringHelper,
+ _contentTypeBaseServiceProvider,
+ Context,
+ _packageMigrationsSettings));
}
diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs
index 9e35999071..fd7193e4ae 100644
--- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs
@@ -299,7 +299,7 @@ internal class ContentTypeRepository : ContentTypeRepositoryBase,
{
// historyCleanup property is not mandatory for api endpoint, handle the case where it's not present.
// DocumentTypeSave doesn't handle this for us like ContentType constructors do.
- if (entity is IContentType entityWithHistoryCleanup)
+ if (entity is IContentTypeWithHistoryCleanup entityWithHistoryCleanup)
{
var dto = new ContentVersionCleanupPolicyDto
{
diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs
index e49e2ffda9..2207bdb16e 100644
--- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs
@@ -14,13 +14,26 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement;
-internal class ExternalLoginRepository : EntityRepositoryBase, IExternalLoginWithKeyRepository
+internal class ExternalLoginRepository : EntityRepositoryBase, IExternalLoginRepository, IExternalLoginWithKeyRepository
{
public ExternalLoginRepository(IScopeAccessor scopeAccessor, AppCaches cache,
ILogger logger)
: base(scopeAccessor, cache, logger)
{
}
+
+ ///
+ [Obsolete("Use method that takes guid as param")]
+ public void DeleteUserLogins(int memberId) => DeleteUserLogins(memberId.ToGuid());
+
+ ///
+ [Obsolete("Use method that takes guid as param")]
+ public void Save(int userId, IEnumerable logins) => Save(userId.ToGuid(), logins);
+
+ ///
+ [Obsolete("Use method that takes guid as param")]
+ public void Save(int userId, IEnumerable tokens) => Save(userId.ToGuid(), tokens);
+
///
/// Query for user tokens
///
diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs
index 67fe818358..323238084f 100644
--- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MacroRepository.cs
@@ -15,7 +15,7 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement;
-internal class MacroRepository : EntityRepositoryBase, IMacroRepository
+internal class MacroRepository : EntityRepositoryBase, IMacroWithAliasRepository
{
private readonly IRepositoryCachePolicy _macroByAliasCachePolicy;
private readonly IShortStringHelper _shortStringHelper;
diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs
index 200af7ad70..02d1383bc3 100644
--- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberRepository.cs
@@ -202,6 +202,13 @@ public class MemberRepository : ContentRepositoryBase(fullSql);
}
+ ///
+ [Obsolete(
+ "This is now a NoOp since last login date is no longer an umbraco property, set the date on the IMember directly and Save it instead, scheduled for removal in V11.")]
+ public void SetLastLogin(string username, DateTime date)
+ {
+ }
+
///
/// Gets paged member results.
///
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs
index f36d7b67ff..70a0aa35dc 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs
@@ -17,8 +17,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"blocklist",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Lists,
- Icon = "icon-thumbnail-list",
- ValueEditorIsReusable = false)]
+ Icon = "icon-thumbnail-list")]
public class BlockListPropertyEditor : BlockEditorPropertyEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/CheckBoxListPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/CheckBoxListPropertyEditor.cs
index e64a7fe16c..76a7fb5b6d 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/CheckBoxListPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/CheckBoxListPropertyEditor.cs
@@ -17,8 +17,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Checkbox list",
"checkboxlist",
Icon = "icon-bulleted-list",
- Group = Constants.PropertyEditors.Groups.Lists,
- ValueEditorIsReusable = true)]
+ Group = Constants.PropertyEditors.Groups.Lists)]
public class CheckBoxListPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ColorPickerPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ColorPickerPropertyEditor.cs
index 1ce8ae4930..1ff39654b1 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ColorPickerPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ColorPickerPropertyEditor.cs
@@ -14,8 +14,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Color Picker",
"colorpicker",
Icon = "icon-colorpicker",
- Group = Constants.PropertyEditors.Groups.Pickers,
- ValueEditorIsReusable = true)]
+ Group = Constants.PropertyEditors.Groups.Pickers)]
public class ColorPickerPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DateTimePropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/DateTimePropertyEditor.cs
index e4fedf37ea..b6c55ebb6c 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/DateTimePropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/DateTimePropertyEditor.cs
@@ -18,8 +18,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Date/Time",
"datepicker",
ValueType = ValueTypes.DateTime,
- Icon = "icon-time",
- ValueEditorIsReusable = true)]
+ Icon = "icon-time")]
public class DateTimePropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DropDownFlexiblePropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/DropDownFlexiblePropertyEditor.cs
index 831f858fb8..aca49d2f42 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/DropDownFlexiblePropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/DropDownFlexiblePropertyEditor.cs
@@ -14,8 +14,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Dropdown",
"dropdownFlexible",
Group = Constants.PropertyEditors.Groups.Lists,
- Icon = "icon-indent",
- ValueEditorIsReusable = true)]
+ Icon = "icon-indent")]
public class DropDownFlexiblePropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/EmailAddressPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/EmailAddressPropertyEditor.cs
index 6edcb61f4d..1561c63e3c 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/EmailAddressPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/EmailAddressPropertyEditor.cs
@@ -12,8 +12,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
EditorType.PropertyValue | EditorType.MacroParameter,
"Email address",
"email",
- Icon = "icon-message",
- ValueEditorIsReusable = true)]
+ Icon = "icon-message")]
public class EmailAddressPropertyEditor : DataEditor
{
private readonly IIOHelper _ioHelper;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
index a2cf5ef6e9..1e5972f41f 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
@@ -21,8 +21,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"File upload",
"fileupload",
Group = Constants.PropertyEditors.Groups.Media,
- Icon = "icon-download-alt",
- ValueEditorIsReusable = true)]
+ Icon = "icon-download-alt")]
public class FileUploadPropertyEditor : DataEditor, IMediaUrlGenerator,
INotificationHandler, INotificationHandler,
INotificationHandler, INotificationHandler,
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
index d2281b0136..bd3f5423ee 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/GridPropertyEditor.cs
@@ -28,8 +28,7 @@ namespace Umbraco.Cms.Core.PropertyEditors
HideLabel = true,
ValueType = ValueTypes.Json,
Icon = "icon-layout",
- Group = Constants.PropertyEditors.Groups.RichContent,
- ValueEditorIsReusable = false)]
+ Group = Constants.PropertyEditors.Groups.RichContent)]
public class GridPropertyEditor : DataEditor
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs
index c3390b3fc5..f7b966e3ad 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs
@@ -28,8 +28,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
ValueType = ValueTypes.Json,
HideLabel = false,
Group = Constants.PropertyEditors.Groups.Media,
- Icon = "icon-crop",
- ValueEditorIsReusable = true)]
+ Icon = "icon-crop")]
public class ImageCropperPropertyEditor : DataEditor, IMediaUrlGenerator,
INotificationHandler, INotificationHandler,
INotificationHandler, INotificationHandler,
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ListViewPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ListViewPropertyEditor.cs
index b1b7c5c034..f027b9edd3 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ListViewPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ListViewPropertyEditor.cs
@@ -17,8 +17,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"listview",
HideLabel = true,
Group = Constants.PropertyEditors.Groups.Lists,
- Icon = Constants.Icons.ListView,
- ValueEditorIsReusable = true)]
+ Icon = Constants.Icons.ListView)]
public class ListViewPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs
index ed774f9215..653c88f1c3 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/MediaPicker3PropertyEditor.cs
@@ -24,8 +24,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"mediapicker3",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Media,
- Icon = Constants.Icons.MediaImage,
- ValueEditorIsReusable = true)]
+ Icon = Constants.Icons.MediaImage)]
public class MediaPicker3PropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MediaPickerPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MediaPickerPropertyEditor.cs
index 5cbc8e91a0..ccc604ef72 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/MediaPickerPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/MediaPickerPropertyEditor.cs
@@ -26,8 +26,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Media,
Icon = Constants.Icons.MediaImage,
- IsDeprecated = false,
- ValueEditorIsReusable = true)]
+ IsDeprecated = false)]
public class MediaPickerPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
index 1e20d8cfec..924f6b6940 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
@@ -18,8 +18,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"contentpicker",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Pickers,
- Icon = "icon-page-add",
- ValueEditorIsReusable = true)]
+ Icon = "icon-page-add")]
public class MultiNodeTreePickerPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerPropertyEditor.cs
index 7387ab7808..4ffed0c1da 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerPropertyEditor.cs
@@ -16,8 +16,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"multiurlpicker",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Pickers,
- Icon = "icon-link",
- ValueEditorIsReusable = true)]
+ Icon = "icon-link")]
public class MultiUrlPickerPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultipleTextStringPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultipleTextStringPropertyEditor.cs
index 4f25a54162..e80da62e9b 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/MultipleTextStringPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/MultipleTextStringPropertyEditor.cs
@@ -25,8 +25,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"multipletextbox",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Lists,
- Icon = "icon-ordered-list",
- ValueEditorIsReusable = true)]
+ Icon = "icon-ordered-list")]
public class MultipleTextStringPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
index 230c6e2b59..880c77134f 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/NestedContentPropertyEditor.cs
@@ -25,8 +25,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"nestedcontent",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Lists,
- Icon = "icon-thumbnail-list",
- ValueEditorIsReusable = false)]
+ Icon = "icon-thumbnail-list")]
public class NestedContentPropertyEditor : DataEditor
{
public const string ContentTypeAliasPropertyKey = "ncContentTypeAlias";
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RadioButtonsPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/RadioButtonsPropertyEditor.cs
index f121e665fe..4fcfb04126 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/RadioButtonsPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/RadioButtonsPropertyEditor.cs
@@ -17,8 +17,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"radiobuttons",
ValueType = ValueTypes.String,
Group = Constants.PropertyEditors.Groups.Lists,
- Icon = "icon-target",
- ValueEditorIsReusable = true)]
+ Icon = "icon-target")]
public class RadioButtonsPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs
index 8525de17b6..98f2d028ea 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs
@@ -29,8 +29,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
ValueType = ValueTypes.Text,
HideLabel = false,
Group = Constants.PropertyEditors.Groups.RichContent,
- Icon = "icon-browser-window",
- ValueEditorIsReusable = true)]
+ Icon = "icon-browser-window")]
public class RichTextPropertyEditor : DataEditor
{
private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/SliderPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/SliderPropertyEditor.cs
index 4ac27824ba..48bfb90a39 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/SliderPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/SliderPropertyEditor.cs
@@ -15,8 +15,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
Constants.PropertyEditors.Aliases.Slider,
"Slider",
"slider",
- Icon = "icon-navigation-horizontal",
- ValueEditorIsReusable = true)]
+ Icon = "icon-navigation-horizontal")]
public class SliderPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs
index 88648c47fd..8357db5b6b 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/TagsPropertyEditor.cs
@@ -23,8 +23,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
Constants.PropertyEditors.Aliases.Tags,
"Tags",
"tags",
- Icon = "icon-tags",
- ValueEditorIsReusable = true)]
+ Icon = "icon-tags")]
public class TagsPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/TextAreaPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/TextAreaPropertyEditor.cs
index acc33a233b..d72f3cb098 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/TextAreaPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/TextAreaPropertyEditor.cs
@@ -18,8 +18,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"Textarea",
"textarea",
ValueType = ValueTypes.Text,
- Icon = "icon-application-window-alt",
- ValueEditorIsReusable = true)]
+ Icon = "icon-application-window-alt")]
public class TextAreaPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/TextboxPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/TextboxPropertyEditor.cs
index bc340b58ba..4f81bf410a 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/TextboxPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/TextboxPropertyEditor.cs
@@ -17,8 +17,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
EditorType.PropertyValue | EditorType.MacroParameter,
"Textbox",
"textbox",
- Group = Constants.PropertyEditors.Groups.Common,
- ValueEditorIsReusable = true)]
+ Group = Constants.PropertyEditors.Groups.Common)]
public class TextboxPropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/TrueFalsePropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/TrueFalsePropertyEditor.cs
index 0a96a3dcee..70ad112470 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/TrueFalsePropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/TrueFalsePropertyEditor.cs
@@ -18,8 +18,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
"boolean",
ValueType = ValueTypes.Integer,
Group = Constants.PropertyEditors.Groups.Common,
- Icon = "icon-checkbox",
- ValueEditorIsReusable = true)]
+ Icon = "icon-checkbox")]
public class TrueFalsePropertyEditor : DataEditor
{
private readonly IEditorConfigurationParser _editorConfigurationParser;
diff --git a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
index 86eba639ce..76eeb33821 100644
--- a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
+++ b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
@@ -169,9 +169,12 @@ public class CoreRuntime : IRuntime
// Acquire the main domain - if this fails then anything that should be registered with MainDom will not operate
AcquireMainDom();
+ // TODO (V10): Remove this obsoleted notification publish.
+ await _eventAggregator.PublishAsync(new UmbracoApplicationMainDomAcquiredNotification(), cancellationToken);
+
// Notify for unattended install
- await _eventAggregator.PublishAsync(new RuntimeUnattendedInstallNotification(), cancellationToken);
- DetermineRuntimeLevel();
+ await _eventAggregator.PublishAsync(new RuntimeUnattendedInstallNotification(), cancellationToken);
+ DetermineRuntimeLevel();
if (!State.UmbracoCanBoot())
{
@@ -209,8 +212,13 @@ public class CoreRuntime : IRuntime
break;
}
+ // TODO (V10): Remove this obsoleted notification publish
+ await _eventAggregator.PublishAsync(
+ new UmbracoApplicationComponentsInstallingNotification(State.Level),
+ cancellationToken);
+
// Initialize the components
- _components.Initialize();
+ _components.Initialize();
await _eventAggregator.PublishAsync(
new UmbracoApplicationStartingNotification(State.Level, isRestarting),
diff --git a/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs b/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
index a6589166b2..9555482bbf 100644
--- a/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
+++ b/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
@@ -46,12 +46,12 @@ public class BackOfficeClaimsPrincipalFactory : UserClaimsPrincipalFactory x.RoleId).ToArray());
diff --git a/src/Umbraco.Infrastructure/Security/BackOfficeErrorDescriber.cs b/src/Umbraco.Infrastructure/Security/BackOfficeErrorDescriber.cs
index b99eddba5d..2b9daab29f 100644
--- a/src/Umbraco.Infrastructure/Security/BackOfficeErrorDescriber.cs
+++ b/src/Umbraco.Infrastructure/Security/BackOfficeErrorDescriber.cs
@@ -20,7 +20,7 @@ public class BackOfficeErrorDescriber : UmbracoErrorDescriberBase
Description = _textService.Localize("validation", "duplicateUserGroupName", new[] { role }),
};
- public override IdentityError InvalidRoleName(string? role) => new()
+ public override IdentityError InvalidRoleName(string role) => new()
{
Code = nameof(InvalidRoleName),
Description = _textService.Localize("validation", "invalidUserGroupName"),
@@ -70,7 +70,7 @@ public class MembersErrorDescriber : UmbracoErrorDescriberBase
Description = _textService.Localize("validation", "duplicateMemberGroupName", new[] { role }),
};
- public override IdentityError InvalidRoleName(string? role) => new()
+ public override IdentityError InvalidRoleName(string role) => new()
{
Code = nameof(InvalidRoleName),
Description = _textService.Localize("validation", "invalidMemberGroupName"),
diff --git a/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs b/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
index 1908a3fbfc..244885887e 100644
--- a/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
+++ b/src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
@@ -81,6 +81,29 @@ public class BackOfficeUserStore : UmbracoUserStore globalSettings,
+ IUmbracoMapper mapper,
+ BackOfficeErrorDescriber describer,
+ AppCaches appCaches)
+ : this(
+ scopeProvider,
+ userService,
+ entityService,
+ StaticServiceProvider.Instance.GetRequiredService(),
+ StaticServiceProvider.Instance.GetRequiredService>(),
+ mapper,
+ describer,
+ appCaches,
+ StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
///
public Task ValidateSessionIdAsync(string? userId, string? sessionId)
{
@@ -117,17 +140,12 @@ public class BackOfficeUserStore : UmbracoUserStore();
- var emptyPasswordValue = Constants.Security.EmptyPasswordPrefix +
+ // the password must be 'something' it could be empty if authenticating
+ // with an external provider so we'll just generate one and prefix it, the
+ // prefix will help us determine if the password hasn't actually been specified yet.
+ // this will hash the guid with a salt so should be nicely random
+ var aspHasher = new PasswordHasher();
+ var emptyPasswordValue = Constants.Security.EmptyPasswordPrefix +
aspHasher.HashPassword(user, Guid.NewGuid().ToString("N"));
var userEntity = new User(_globalSettings, user.Name, user.Email, user.UserName, emptyPasswordValue)
@@ -260,14 +278,16 @@ public class BackOfficeUserStore : UmbracoUserStore
- public override Task FindByNameAsync(string userName, CancellationToken cancellationToken = default)
+ public override Task FindByNameAsync(
+ string userName,
+ CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
IUser? user = _userService.GetByUsername(userName);
if (user == null)
{
- return Task.FromResult(null);
+ return Task.FromResult((BackOfficeIdentityUser)null!);
}
BackOfficeIdentityUser? result = AssignLoginsCallback(_mapper.Map(user));
@@ -276,7 +296,7 @@ public class BackOfficeUserStore : UmbracoUserStore
- protected override Task FindUserAsync(string userId, CancellationToken cancellationToken)
+ protected override Task FindUserAsync(string userId, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -291,7 +311,7 @@ public class BackOfficeUserStore : UmbracoUserStore
- public override Task FindByEmailAsync(
+ public override Task FindByEmailAsync(
string email,
CancellationToken cancellationToken = default)
{
@@ -302,11 +322,11 @@ public class BackOfficeUserStore : UmbracoUserStore(user);
- return Task.FromResult(AssignLoginsCallback(result));
+ return Task.FromResult(AssignLoginsCallback(result))!;
}
///
- public override async Task SetPasswordHashAsync(BackOfficeIdentityUser user, string? passwordHash, CancellationToken cancellationToken = default)
+ public override async Task SetPasswordHashAsync(BackOfficeIdentityUser user, string passwordHash, CancellationToken cancellationToken = default)
{
await base.SetPasswordHashAsync(user, passwordHash, cancellationToken);
@@ -408,7 +428,7 @@ public class BackOfficeUserStore : UmbracoUserStore
///
- public override Task SetTokenAsync(BackOfficeIdentityUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken)
+ public override Task SetTokenAsync(BackOfficeIdentityUser user, string loginProvider, string name, string value, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -440,15 +460,15 @@ public class BackOfficeUserStore : UmbracoUserStore
- protected override async Task?> FindUserLoginAsync(string userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
+ protected override async Task> FindUserLoginAsync(string userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
- BackOfficeIdentityUser? user = await FindUserAsync(userId, cancellationToken);
- if (user?.Id is null)
+ BackOfficeIdentityUser user = await FindUserAsync(userId, cancellationToken);
+ if (user is null || user.Id is null)
{
- return null;
+ return null!;
}
IList logins = await GetLoginsAsync(user, cancellationToken);
@@ -456,7 +476,7 @@ public class BackOfficeUserStore : UmbracoUserStore x.ProviderKey == providerKey && x.LoginProvider == loginProvider);
if (found == null)
{
- return null;
+ return null!;
}
return new IdentityUserLogin
@@ -469,7 +489,7 @@ public class BackOfficeUserStore : UmbracoUserStore
- protected override Task?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
+ protected override Task> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -477,11 +497,11 @@ public class BackOfficeUserStore : UmbracoUserStore?>(null);
+ return Task.FromResult((IdentityUserLogin)null!);
}
IIdentityUserLogin found = logins[0];
- return Task.FromResult?>(new IdentityUserLogin
+ return Task.FromResult(new IdentityUserLogin
{
LoginProvider = found.LoginProvider,
ProviderKey = found.ProviderKey,
@@ -491,33 +511,30 @@ public class BackOfficeUserStore : UmbracoUserStore
- protected override Task?> FindRoleAsync(
+ protected override Task> FindRoleAsync(
string normalizedRoleName,
CancellationToken cancellationToken)
{
IUserGroup? group = _userService.GetUserGroupByAlias(normalizedRoleName);
- if (group?.Name is null)
+ if (group == null)
{
- return Task.FromResult?>(null);
+ return Task.FromResult((IdentityRole)null!);
}
- return Task.FromResult?>(new IdentityRole(group.Name)
- {
- Id = group.Alias,
- });
+ return Task.FromResult(new IdentityRole(group.Name) { Id = group.Alias });
}
///
- protected override async Task?> FindUserRoleAsync(string userId, string roleId, CancellationToken cancellationToken)
+ protected override async Task> FindUserRoleAsync(string userId, string roleId, CancellationToken cancellationToken)
{
- BackOfficeIdentityUser? user = await FindUserAsync(userId, cancellationToken);
+ BackOfficeIdentityUser user = await FindUserAsync(userId, cancellationToken);
if (user == null)
{
return null!;
}
IdentityUserRole? found = user.Roles.FirstOrDefault(x => x.RoleId.InvariantEquals(roleId));
- return found;
+ return found!;
}
private BackOfficeIdentityUser? AssignLoginsCallback(BackOfficeIdentityUser? user)
@@ -589,7 +606,7 @@ public class BackOfficeUserStore : UmbracoUserStore
- /// Overridden to support Umbraco's own data storage requirements
+ /// Overridden to support Umbraco's own data storage requirements
///
///
- /// The base class's implementation of this calls into FindTokenAsync, RemoveUserTokenAsync and AddUserTokenAsync, both methods will only work with ORMs that are change
- /// tracking ORMs like EFCore.
+ /// The base class's implementation of this calls into FindTokenAsync, RemoveUserTokenAsync and AddUserTokenAsync, both
+ /// methods will only work with ORMs that are change
+ /// tracking ORMs like EFCore.
///
///
public override Task RemoveTokenAsync(BackOfficeIdentityUser user, string loginProvider, string name, CancellationToken cancellationToken)
diff --git a/src/Umbraco.Infrastructure/Security/ClaimsIdentityExtensions.cs b/src/Umbraco.Infrastructure/Security/ClaimsIdentityExtensions.cs
index c914930e9e..05ab03b784 100644
--- a/src/Umbraco.Infrastructure/Security/ClaimsIdentityExtensions.cs
+++ b/src/Umbraco.Infrastructure/Security/ClaimsIdentityExtensions.cs
@@ -38,9 +38,9 @@ public static class MergeClaimsIdentityExtensions
{
foreach (IdentityUserClaim claim in source.Claims
.Where(claim => !_ignoredClaims.Contains(claim.ClaimType))
- .Where(claim => !destination.HasClaim(claim.ClaimType!, claim.ClaimValue!)))
+ .Where(claim => !destination.HasClaim(claim.ClaimType, claim.ClaimValue)))
{
- destination.AddClaim(new Claim(claim.ClaimType!, claim.ClaimValue!));
+ destination.AddClaim(new Claim(claim.ClaimType, claim.ClaimValue));
}
}
}
diff --git a/src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs b/src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs
index 714db070bb..fe34812334 100644
--- a/src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs
+++ b/src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs
@@ -22,14 +22,14 @@ public interface IUmbracoUserManager : IDisposable
///
/// The
/// A representing the result of the asynchronous operation.
- Task GetUserAsync(ClaimsPrincipal principal);
+ Task GetUserAsync(ClaimsPrincipal principal);
///
/// Get the user id from the
///
/// the
/// Returns the user id from the
- string? GetUserId(ClaimsPrincipal principal);
+ string GetUserId(ClaimsPrincipal principal);
///
/// Gets the external logins for the user
@@ -47,7 +47,7 @@ public interface IUmbracoUserManager : IDisposable
/// Finds a user by the external login provider
///
/// A representing the result of the asynchronous operation.
- Task FindByLoginAsync(string loginProvider, string providerKey);
+ Task FindByLoginAsync(string loginProvider, string providerKey);
///
/// Finds and returns a user, if any, who has the specified .
@@ -57,7 +57,7 @@ public interface IUmbracoUserManager : IDisposable
/// The that represents the asynchronous operation, containing the user matching the specified
/// if it exists.
///
- Task FindByIdAsync(string userId);
+ Task FindByIdAsync(string? userId);
///
/// Generates a password reset token for the specified , using
@@ -80,7 +80,7 @@ public interface IUmbracoUserManager : IDisposable
/// is to generate a token and reset it, however, when we do this we want to track a password change, not a password
/// reset
///
- Task ChangePasswordWithResetAsync(string userId, string token, string newPassword);
+ Task ChangePasswordWithResetAsync(string userId, string token, string? newPassword);
///
/// Validates that an email confirmation token matches the specified .
@@ -91,7 +91,7 @@ public interface IUmbracoUserManager : IDisposable
/// The that represents the asynchronous operation, containing the
/// of the operation.
///
- Task ConfirmEmailAsync(TUser user, string token);
+ Task ConfirmEmailAsync(TUser user, string? token);
///
/// Gets the user, if any, associated with the normalized value of the specified email address.
@@ -103,7 +103,7 @@ public interface IUmbracoUserManager : IDisposable
/// The task object containing the results of the asynchronous lookup operation, the user, if any, associated with a
/// normalized value of the specified email address.
///
- Task FindByEmailAsync(string email);
+ Task FindByEmailAsync(string email);
///
/// Resets the 's password to the specified after
@@ -116,7 +116,7 @@ public interface IUmbracoUserManager : IDisposable
/// The that represents the asynchronous operation, containing the
/// of the operation.
///
- Task ResetPasswordAsync(TUser user, string token, string newPassword);
+ Task ResetPasswordAsync(TUser user, string? token, string? newPassword);
///
/// Override to check the user approval value as well as the user lock out date, by default this only checks the user's
@@ -216,7 +216,7 @@ public interface IUmbracoUserManager : IDisposable
/// The that represents the asynchronous operation, containing the
/// of the operation.
///
- Task ChangePasswordAsync(TUser user, string currentPassword, string newPassword);
+ Task ChangePasswordAsync(TUser user, string? currentPassword, string? newPassword);
///
/// Used to validate a user's session
@@ -268,7 +268,7 @@ public interface IUmbracoUserManager : IDisposable
/// The that represents the asynchronous operation, containing the
/// of the operation.
///
- Task CreateAsync(TUser user, string password);
+ Task CreateAsync(TUser user, string? password);
///
/// Generate a password for a user based on the current password validator
@@ -302,7 +302,7 @@ public interface IUmbracoUserManager : IDisposable
/// The that represents the asynchronous operation, containing the user matching the specified
/// if it exists.
///
- Task FindByNameAsync(string userName);
+ Task FindByNameAsync(string userName);
///
/// Increments the access failed count for the user as an asynchronous operation.
@@ -373,7 +373,7 @@ public interface IUmbracoUserManager : IDisposable
/// The System.Threading.Tasks.Task that represents the asynchronous operation, containing the
/// Microsoft.AspNetCore.Identity.IdentityResult of the operation.
///
- Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey);
+ Task RemoveLoginAsync(TUser user, string? loginProvider, string? providerKey);
///
/// Resets the access failed count for the user
@@ -395,7 +395,7 @@ public interface IUmbracoUserManager : IDisposable
/// The task object containing the results of the asynchronous operation, the email address for the specified
/// user.
///
- Task GetEmailAsync(TUser user);
+ Task GetEmailAsync(TUser user);
///
/// Gets the telephone number, if any, for the specified user.
@@ -409,7 +409,7 @@ public interface IUmbracoUserManager : IDisposable
/// A user can only support a phone number if the BackOfficeUserStore is replaced with another that implements
/// IUserPhoneNumberStore
///
- Task GetPhoneNumberAsync(TUser user);
+ Task GetPhoneNumberAsync(TUser user);
///
/// Validates that a user's credentials are correct without actually logging them in.
diff --git a/src/Umbraco.Infrastructure/Security/MemberRoleStore.cs b/src/Umbraco.Infrastructure/Security/MemberRoleStore.cs
index b355bbcb18..eeeed4e4ec 100644
--- a/src/Umbraco.Infrastructure/Security/MemberRoleStore.cs
+++ b/src/Umbraco.Infrastructure/Security/MemberRoleStore.cs
@@ -131,7 +131,7 @@ public class MemberRoleStore : IQueryableRoleStore
}
///
- public Task GetRoleNameAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
+ public Task GetRoleNameAsync(UmbracoIdentityRole role, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -141,11 +141,11 @@ public class MemberRoleStore : IQueryableRoleStore
throw new ArgumentNullException(nameof(role));
}
- return Task.FromResult(role.Name);
+ return Task.FromResult(role.Name)!;
}
///
- public Task SetRoleNameAsync(UmbracoIdentityRole role, string? roleName,
+ public Task SetRoleNameAsync(UmbracoIdentityRole role, string roleName,
CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -155,24 +155,23 @@ public class MemberRoleStore : IQueryableRoleStore
throw new ArgumentNullException(nameof(role));
}
-
- role.Name = roleName;
- return Task.CompletedTask;
- }
+ role.Name = roleName;
+ return Task.CompletedTask;
+ }
///
- public Task GetNormalizedRoleNameAsync(
+ public Task GetNormalizedRoleNameAsync(
UmbracoIdentityRole role,
CancellationToken cancellationToken = default)
=> GetRoleNameAsync(role, cancellationToken);
///
- public Task SetNormalizedRoleNameAsync(UmbracoIdentityRole role, string? normalizedName,
+ public Task SetNormalizedRoleNameAsync(UmbracoIdentityRole role, string normalizedName,
CancellationToken cancellationToken = default)
=> SetRoleNameAsync(role, normalizedName, cancellationToken);
///
- public Task FindByIdAsync(string roleId, CancellationToken cancellationToken = default)
+ public Task FindByIdAsync(string roleId, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -186,37 +185,37 @@ public class MemberRoleStore : IQueryableRoleStore
// member group can be found by int or Guid, so try both
if (!int.TryParse(roleId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var id))
+ {
+ if (!Guid.TryParse(roleId, out Guid guid))
{
- if (!Guid.TryParse(roleId, out Guid guid))
- {
- throw new ArgumentOutOfRangeException(nameof(roleId), $"{nameof(roleId)} is not a valid Guid");
- }
+ throw new ArgumentOutOfRangeException(nameof(roleId), $"{nameof(roleId)} is not a valid Guid");
+ }
- memberGroup = _memberGroupService.GetById(guid);
+ memberGroup = _memberGroupService.GetById(guid);
}
else
{
memberGroup = _memberGroupService.GetById(id);
}
- return Task.FromResult(memberGroup == null ? null : MapFromMemberGroup(memberGroup));
+ return Task.FromResult(memberGroup == null ? null : MapFromMemberGroup(memberGroup))!;
}
///
- public Task FindByNameAsync(string name, CancellationToken cancellationToken = default)
+ public Task FindByNameAsync(string name, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
- if (string.IsNullOrWhiteSpace(name))
- {
- throw new ArgumentNullException(nameof(name));
- }
-
- IMemberGroup? memberGroup = _memberGroupService.GetByName(name);
- return Task.FromResult(memberGroup == null ? null : MapFromMemberGroup(memberGroup))!;
+ if (string.IsNullOrWhiteSpace(name))
+ {
+ throw new ArgumentNullException(nameof(name));
}
+ IMemberGroup? memberGroup = _memberGroupService.GetByName(name);
+ return Task.FromResult(memberGroup == null ? null : MapFromMemberGroup(memberGroup))!;
+ }
+
///
/// Dispose the store
///
diff --git a/src/Umbraco.Infrastructure/Security/MemberUserStore.cs b/src/Umbraco.Infrastructure/Security/MemberUserStore.cs
index bd52d43d8b..70efeeb739 100644
--- a/src/Umbraco.Infrastructure/Security/MemberUserStore.cs
+++ b/src/Umbraco.Infrastructure/Security/MemberUserStore.cs
@@ -62,7 +62,7 @@ public class MemberUserStore : UmbracoUserStore(),
StaticServiceProvider.Instance.GetRequiredService())
@@ -91,7 +91,7 @@ public class MemberUserStore : UmbracoUserStore
- public override Task FindByNameAsync(string userName, CancellationToken cancellationToken = default)
+ public override Task FindByNameAsync(
+ string userName,
+ CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
IMember? user = _memberService.GetByUsername(userName);
if (user == null)
{
- return Task.FromResult(null);
+ return Task.FromResult((MemberIdentityUser)null!);
}
- MemberIdentityUser? result = AssignLoginsCallback(_mapper.Map(user))!;
+ MemberIdentityUser result = AssignLoginsCallback(_mapper.Map(user))!;
- return Task.FromResult(result);
+ return Task.FromResult(result);
}
public IPublishedContent? GetPublishedMember(MemberIdentityUser? user)
@@ -294,7 +296,7 @@ public class MemberUserStore : UmbracoUserStore
- public override Task FindByEmailAsync(
+ public override Task FindByEmailAsync(
string email,
CancellationToken cancellationToken = default)
{
@@ -305,11 +307,11 @@ public class MemberUserStore : UmbracoUserStore(member);
- return Task.FromResult(AssignLoginsCallback(result));
+ return Task.FromResult(AssignLoginsCallback(result))!;
}
///
- protected override Task FindUserAsync(string userId, CancellationToken cancellationToken)
+ protected override Task FindUserAsync(string userId, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -324,7 +326,7 @@ public class MemberUserStore : UmbracoUserStore(user)))!;
@@ -444,7 +446,7 @@ public class MemberUserStore : UmbracoUserStore
- protected override async Task?> FindUserLoginAsync(string userId, string loginProvider,
+ protected override async Task> FindUserLoginAsync(string userId, string loginProvider,
string providerKey, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -460,32 +462,38 @@ public class MemberUserStore : UmbracoUserStore?>(null);
+ return await Task.FromResult((IdentityUserLogin)null!);
}
IList logins = await GetLoginsAsync(user, cancellationToken);
UserLoginInfo? found =
logins.FirstOrDefault(x => x.ProviderKey == providerKey && x.LoginProvider == loginProvider);
- if (found is null)
+ if (found == null)
{
- return await Task.FromResult?>(null);
+ return await Task.FromResult((IdentityUserLogin)null!);
}
- return new IdentityUserLogin
+ if (user.Id is not null)
{
- LoginProvider = found.LoginProvider,
- ProviderKey = found.ProviderKey,
- // TODO: We don't store this value so it will be null
- ProviderDisplayName = found.ProviderDisplayName,
- UserId = user.Id
- };
+ return new IdentityUserLogin
+ {
+ LoginProvider = found.LoginProvider,
+ ProviderKey = found.ProviderKey,
+
+ // TODO: We don't store this value so it will be null
+ ProviderDisplayName = found.ProviderDisplayName,
+ UserId = user.Id,
+ };
+ }
+
+ return null!;
}
///
- protected override Task?> FindUserLoginAsync(string loginProvider, string providerKey,
+ protected override Task> FindUserLoginAsync(string loginProvider, string providerKey,
CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -504,11 +512,11 @@ public class MemberUserStore : UmbracoUserStore?>(null);
+ return Task.FromResult((IdentityUserLogin)null!);
}
IIdentityUserLogin found = logins[0];
- return Task.FromResult?>(new IdentityUserLogin
+ return Task.FromResult(new IdentityUserLogin
{
LoginProvider = found.LoginProvider,
ProviderKey = found.ProviderKey,
@@ -525,7 +533,7 @@ public class MemberUserStore : UmbracoUserStore currentRoles = _memberService.GetAllRoles(user.UserName!);
+ IEnumerable currentRoles = _memberService.GetAllRoles(user.UserName);
ICollection> roles = currentRoles
.Select(role => new IdentityUserRole { RoleId = role, UserId = user.Id }).ToList();
@@ -536,7 +544,7 @@ public class MemberUserStore : UmbracoUserStore
/// Lists all users of a given role.
///
- public override Task> GetUsersInRoleAsync(
+ public override Task?> GetUsersInRoleAsync(
string roleName,
CancellationToken cancellationToken = default)
{
@@ -548,10 +556,10 @@ public class MemberUserStore : UmbracoUserStore members = _memberService.GetMembersByMemberType(roleName);
+ IEnumerable? members = _memberService.GetMembersByMemberType(roleName);
- IList membersIdentityUsers =
- members.Select(x => _mapper.Map(x)!).ToList();
+ IList? membersIdentityUsers =
+ members?.Select(x => _mapper.Map(x)!).ToList();
return Task.FromResult(membersIdentityUsers);
}
@@ -565,7 +573,8 @@ public class MemberUserStore : UmbracoUserStore
///
- public override Task SetTokenAsync(MemberIdentityUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken)
+ public override Task SetTokenAsync(MemberIdentityUser user, string loginProvider, string name, string value,
+ CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
@@ -623,7 +632,7 @@ public class MemberUserStore : UmbracoUserStore
- protected override Task FindRoleAsync(string roleName, CancellationToken cancellationToken)
+ protected override Task FindRoleAsync(string roleName, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(roleName))
{
@@ -631,12 +640,12 @@ public class MemberUserStore : UmbracoUserStore x.Name == roleName);
- if (group?.Name is null)
+ if (group == null)
{
- return Task.FromResult(null);
+ return Task.FromResult((UmbracoIdentityRole)null!);
}
- return Task.FromResult(new UmbracoIdentityRole(group.Name)
+ return Task.FromResult(new UmbracoIdentityRole(group.Name)
{
// TODO: what should the alias be?
Id = group.Id.ToString(),
@@ -644,25 +653,27 @@ public class MemberUserStore : UmbracoUserStore
- protected override async Task?> FindUserRoleAsync(string userId, string roleId,
+ protected override async Task> FindUserRoleAsync(string userId, string roleId,
CancellationToken cancellationToken)
{
- MemberIdentityUser? user = await FindUserAsync(userId, cancellationToken);
- if (user is null)
+ MemberIdentityUser user = await FindUserAsync(userId, cancellationToken);
+ if (user == null)
{
- return null;
+ return null!;
}
IdentityUserRole? found = user.Roles.FirstOrDefault(x => x.RoleId.InvariantEquals(roleId));
- return found;
+ return found!;
}
private MemberIdentityUser? AssignLoginsCallback(MemberIdentityUser? user)
{
- if (user is not null)
+ if (user != null)
{
- user.SetLoginsCallback(new Lazy?>(() => _externalLoginService.GetExternalLogins(user.Key)));
- user.SetTokensCallback(new Lazy?>(() => _externalLoginService.GetExternalLoginTokens(user.Key)));
+ user.SetLoginsCallback(
+ new Lazy?>(() => _externalLoginService.GetExternalLogins(user.Key)));
+ user.SetTokensCallback(new Lazy?>(() =>
+ _externalLoginService.GetExternalLoginTokens(user.Key)));
}
return user;
@@ -725,7 +736,7 @@ public class MemberUserStore : UmbracoUserStore
public class NoopLookupNormalizer : ILookupNormalizer
{
- public string? NormalizeName(string? name) => name;
+ public string NormalizeName(string name) => name;
- public string? NormalizeEmail(string? email) => email;
+ public string NormalizeEmail(string email) => email;
}
diff --git a/src/Umbraco.Infrastructure/Security/UmbracoErrorDescriberBase.cs b/src/Umbraco.Infrastructure/Security/UmbracoErrorDescriberBase.cs
index ade4fd1515..671483fe7b 100644
--- a/src/Umbraco.Infrastructure/Security/UmbracoErrorDescriberBase.cs
+++ b/src/Umbraco.Infrastructure/Security/UmbracoErrorDescriberBase.cs
@@ -34,7 +34,7 @@ public abstract class UmbracoErrorDescriberBase : IdentityErrorDescriber
Description = _textService.Localize("validation", "duplicateUsername", new[] { userName }),
};
- public override IdentityError InvalidEmail(string? email) => new()
+ public override IdentityError InvalidEmail(string email) => new()
{
Code = nameof(InvalidEmail),
Description = _textService.Localize("validation", "invalidEmail"),
@@ -46,7 +46,7 @@ public abstract class UmbracoErrorDescriberBase : IdentityErrorDescriber
Description = _textService.Localize("validation", "invalidToken"),
};
- public override IdentityError InvalidUserName(string? userName) => new()
+ public override IdentityError InvalidUserName(string userName) => new()
{
Code = nameof(InvalidUserName),
Description = _textService.Localize("validation", "invalidUsername"),
diff --git a/src/Umbraco.Infrastructure/Security/UmbracoIdentityRole.cs b/src/Umbraco.Infrastructure/Security/UmbracoIdentityRole.cs
index af6e745f46..e38a0b89ab 100644
--- a/src/Umbraco.Infrastructure/Security/UmbracoIdentityRole.cs
+++ b/src/Umbraco.Infrastructure/Security/UmbracoIdentityRole.cs
@@ -6,10 +6,10 @@ namespace Umbraco.Cms.Core.Security;
public class UmbracoIdentityRole : IdentityRole, IRememberBeingDirty
{
- private string _id = string.Empty;
- private string _name = string.Empty;
+ private string? _id;
+ private string? _name;
- public UmbracoIdentityRole(string roleName)
+ public UmbracoIdentityRole(string? roleName)
: base(roleName)
{
}
@@ -26,7 +26,7 @@ public class UmbracoIdentityRole : IdentityRole, IRememberBeingDirty
}
///
- public override string Id
+ public override string? Id
{
get => _id;
set
@@ -40,11 +40,11 @@ public class UmbracoIdentityRole : IdentityRole, IRememberBeingDirty
public override string? Name
{
get => _name;
- set => BeingDirty.SetPropertyValueAndDetectChanges(value, ref _name!, nameof(Name));
+ set => BeingDirty.SetPropertyValueAndDetectChanges(value, ref _name, nameof(Name));
}
///
- public override string? NormalizedName { get => base.Name ?? string.Empty; set => base.Name = value; }
+ public override string NormalizedName { get => base.Name; set => base.Name = value; }
///
/// Gets or sets a value indicating whether returns an Id has been set on this object this will be false if the object
@@ -58,7 +58,7 @@ public class UmbracoIdentityRole : IdentityRole, IRememberBeingDirty
// model. A good writeup of that is here:
// https://stackoverflow.com/a/37362173
// For our purposes currently we won't worry about this.
- public override string? ConcurrencyStamp { get => base.ConcurrencyStamp; set => base.ConcurrencyStamp = value; }
+ public override string ConcurrencyStamp { get => base.ConcurrencyStamp; set => base.ConcurrencyStamp = value; }
///
/// Gets the for change tracking
diff --git a/src/Umbraco.Infrastructure/Security/UmbracoIdentityUser.cs b/src/Umbraco.Infrastructure/Security/UmbracoIdentityUser.cs
index 7a44933e46..bf79ab602d 100644
--- a/src/Umbraco.Infrastructure/Security/UmbracoIdentityUser.cs
+++ b/src/Umbraco.Infrastructure/Security/UmbracoIdentityUser.cs
@@ -71,7 +71,7 @@ public abstract class UmbracoIdentityUser : IdentityUser, IRememberBeingDirty
// model. A good writeup of that is here:
// https://stackoverflow.com/a/37362173
// For our purposes currently we won't worry about this.
- public override string? ConcurrencyStamp { get => base.ConcurrencyStamp; set => base.ConcurrencyStamp = value; }
+ public override string ConcurrencyStamp { get => base.ConcurrencyStamp; set => base.ConcurrencyStamp = value; }
///
/// Gets or sets last login date
@@ -85,7 +85,7 @@ public abstract class UmbracoIdentityUser : IdentityUser, IRememberBeingDirty
///
/// Gets or sets email
///
- public override string? Email
+ public override string Email
{
get => _email;
set => BeingDirty.SetPropertyValueAndDetectChanges(value, ref _email!, nameof(Email));
@@ -247,7 +247,7 @@ public abstract class UmbracoIdentityUser : IdentityUser, IRememberBeingDirty
///
/// Gets or sets user name
///
- public override string? UserName
+ public override string UserName
{
get => _userName;
set => BeingDirty.SetPropertyValueAndDetectChanges(value, ref _userName!, nameof(UserName));
diff --git a/src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs b/src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
index dd3572c928..bc8b8078ca 100644
--- a/src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
+++ b/src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
@@ -134,8 +134,8 @@ public abstract class UmbracoUserManager : UserManager
public override async Task CheckPasswordAsync(TUser user, string? password)
{
- // we cannot proceed if the user passed in does not have an identity, or if no password is provided.
- if (user.HasIdentity == false || password is null)
+ // we cannot proceed if the user passed in does not have an identity
+ if (user.HasIdentity == false)
{
return false;
}
@@ -158,10 +158,10 @@ public abstract class UmbracoUserManager : UserManager
- public virtual async Task ChangePasswordWithResetAsync(string userId, string token, string newPassword)
+ public virtual async Task ChangePasswordWithResetAsync(string userId, string token, string? newPassword)
{
- TUser? user = await FindByIdAsync(userId);
- if (user is null)
+ TUser user = await FindByIdAsync(userId);
+ if (user == null)
{
throw new InvalidOperationException("Could not find user");
}
@@ -251,8 +251,8 @@ public abstract class UmbracoUserManager : UserManager ValidateCredentialsAsync(string username, string password)
{
- TUser? user = await FindByNameAsync(username);
- if (user is null)
+ TUser user = await FindByNameAsync(username);
+ if (user == null)
{
return false;
}
diff --git a/src/Umbraco.Infrastructure/Security/UmbracoUserStore.cs b/src/Umbraco.Infrastructure/Security/UmbracoUserStore.cs
index 35a8f2eea9..7a6c9d793a 100644
--- a/src/Umbraco.Infrastructure/Security/UmbracoUserStore.cs
+++ b/src/Umbraco.Infrastructure/Security/UmbracoUserStore.cs
@@ -84,7 +84,7 @@ public abstract class UmbracoUserStore
}
///
- public override Task FindByIdAsync(string userId, CancellationToken cancellationToken = default) =>
+ public override Task FindByIdAsync(string userId, CancellationToken cancellationToken = default) =>
FindUserAsync(userId, cancellationToken);
///
@@ -96,11 +96,11 @@ public abstract class UmbracoUserStore
throw new NotImplementedException();
///
- public override Task GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken)
+ public override Task GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken)
=> GetEmailAsync(user, cancellationToken);
///
- public override Task GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken = default)
+ public override Task GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken = default)
=> GetUserNameAsync(user, cancellationToken);
///
@@ -221,15 +221,15 @@ public abstract class UmbracoUserStore
public override Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default) => throw new NotImplementedException();
///
- public override Task SetNormalizedEmailAsync(TUser user, string? normalizedEmail, CancellationToken cancellationToken)
+ public override Task SetNormalizedEmailAsync(TUser user, string normalizedEmail, CancellationToken cancellationToken)
=> SetEmailAsync(user, normalizedEmail, cancellationToken);
///
- public override Task SetNormalizedUserNameAsync(TUser user, string? normalizedName, CancellationToken cancellationToken = default)
+ public override Task SetNormalizedUserNameAsync(TUser user, string normalizedName, CancellationToken cancellationToken = default)
=> SetUserNameAsync(user, normalizedName, cancellationToken);
///
- public override async Task SetPasswordHashAsync(TUser user, string? passwordHash, CancellationToken cancellationToken = default)
+ public override async Task SetPasswordHashAsync(TUser user, string passwordHash, CancellationToken cancellationToken = default)
{
await base.SetPasswordHashAsync(user, passwordHash, cancellationToken);
user.LastPasswordChangeDateUtc = DateTime.UtcNow;
@@ -247,7 +247,7 @@ public abstract class UmbracoUserStore
///
///
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Task?> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken) => throw new NotImplementedException();
+ protected override Task> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken) => throw new NotImplementedException();
///
/// Not supported in Umbraco, see comments above on GetTokenAsync, RemoveTokenAsync, SetTokenAsync
diff --git a/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs b/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
index 5257b2f141..721e99bbd7 100644
--- a/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
+++ b/src/Umbraco.Infrastructure/Templates/HtmlMacroParameterParser.cs
@@ -79,7 +79,7 @@ public sealed class HtmlMacroParameterParser : IHtmlMacroParameterParser
private IEnumerable GetUmbracoEntityReferencesFromMacros(
List>> macros)
{
- if (_macroService is not IMacroService macroWithAliasService)
+ if (_macroService is not IMacroWithAliasService macroWithAliasService)
{
yield break;
}
diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
index 5070378d6c..93219af4c9 100644
--- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
+++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
Umbraco.Cms.Infrastructure
Umbraco.Cms.Infrastructure
Umbraco CMS Infrastructure
@@ -18,16 +18,11 @@
-
-
+
+
-
-
-
-
-
@@ -41,26 +36,23 @@
-
+
-
+
-
+
-
-
-
-
+
all
diff --git a/src/Umbraco.New.Cms.Core/Umbraco.New.Cms.Core.csproj b/src/Umbraco.New.Cms.Core/Umbraco.New.Cms.Core.csproj
index 0e0cb355cb..e7c38a23af 100644
--- a/src/Umbraco.New.Cms.Core/Umbraco.New.Cms.Core.csproj
+++ b/src/Umbraco.New.Cms.Core/Umbraco.New.Cms.Core.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
enable
enable
Umbraco.New.Cms.Core
diff --git a/src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj b/src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
index 37a91d4599..27e27cc981 100644
--- a/src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
+++ b/src/Umbraco.New.Cms.Infrastructure/Umbraco.New.Cms.Infrastructure.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
enable
enable
Umbraco.New.Cms.Infrastructure
diff --git a/src/Umbraco.New.Cms.Web.Common/Installer/SignInUserStep.cs b/src/Umbraco.New.Cms.Web.Common/Installer/SignInUserStep.cs
index accb5fd82b..62954c61e0 100644
--- a/src/Umbraco.New.Cms.Web.Common/Installer/SignInUserStep.cs
+++ b/src/Umbraco.New.Cms.Web.Common/Installer/SignInUserStep.cs
@@ -20,14 +20,12 @@ public class SignInUserStep : IInstallStep
_backOfficeUserManager = backOfficeUserManager;
}
+ public InstallationType InstallationTypeTarget => InstallationType.NewInstall;
+
public async Task ExecuteAsync(InstallData model)
{
- BackOfficeIdentityUser? identityUser = await _backOfficeUserManager.FindByIdAsync(Constants.Security.SuperUserIdAsString);
-
- if (identityUser is not null)
- {
- await _backOfficeSignInManager.SignInAsync(identityUser, false);
- }
+ BackOfficeIdentityUser identityUser = await _backOfficeUserManager.FindByIdAsync(Constants.Security.SuperUserIdAsString);
+ await _backOfficeSignInManager.SignInAsync(identityUser, false);
}
public Task RequiresExecutionAsync(InstallData model) => Task.FromResult(true);
diff --git a/src/Umbraco.New.Cms.Web.Common/Umbraco.New.Cms.Web.Common.csproj b/src/Umbraco.New.Cms.Web.Common/Umbraco.New.Cms.Web.Common.csproj
index d9826126de..159537c9d8 100644
--- a/src/Umbraco.New.Cms.Web.Common/Umbraco.New.Cms.Web.Common.csproj
+++ b/src/Umbraco.New.Cms.Web.Common/Umbraco.New.Cms.Web.Common.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
enable
enable
false
diff --git a/src/Umbraco.PublishedCache.NuCache/ContentCache.cs b/src/Umbraco.PublishedCache.NuCache/ContentCache.cs
index d8a5c0bc04..7a440ef768 100644
--- a/src/Umbraco.PublishedCache.NuCache/ContentCache.cs
+++ b/src/Umbraco.PublishedCache.NuCache/ContentCache.cs
@@ -243,7 +243,7 @@ public class ContentCache : PublishedCacheBase, IPublishedContentCache, INavigab
IPublishedContent? rootNode = GetByRoute(preview, "/", true);
if (rootNode == null)
{
- throw new Exception("Failed to get node at /. This might be because you're trying to publish a variant, with no domains setup");
+ throw new Exception("Failed to get node at /.");
}
// remove only if we're the default node
diff --git a/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs b/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs
index c47c04b548..6f0360bba8 100644
--- a/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs
+++ b/src/Umbraco.PublishedCache.NuCache/ContentNodeKit.cs
@@ -1,18 +1,22 @@
-using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PublishedCache;
using Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
namespace Umbraco.Cms.Infrastructure.PublishedCache;
- public struct ContentNodeKit
- {
- public ContentNode Node { get; } = null!;
+public struct ContentNodeKit
+{
+ [Obsolete("This will be changed to a property in future versions")]
+ public ContentNode Node = null!;
- public int ContentTypeId { get; }
+ [Obsolete("This will be changed to a property in future versions")]
+ public int ContentTypeId;
- public ContentData? DraftData { get; }
+ [Obsolete("This will be changed to a property in future versions")]
+ public ContentData? DraftData;
- public ContentData? PublishedData { get; }
+ [Obsolete("This will be changed to a property in future versions")]
+ public ContentData? PublishedData;
public ContentNodeKit(ContentNode node, int contentTypeId, ContentData? draftData, ContentData? publishedData)
{
diff --git a/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs b/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs
index a7e0b60373..7e209cb97d 100644
--- a/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs
+++ b/src/Umbraco.PublishedCache.NuCache/DataSource/ContentData.cs
@@ -1,11 +1,30 @@
-namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
+namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
///
-/// Represents everything that is specific to an edited or published content version
+/// Represents everything that is specific to an edited or published content version
///
public class ContentData
{
- public ContentData(string? name, string? urlSegment, int versionId, DateTime versionDate, int writerId, int? templateId, bool published, IDictionary? properties, IReadOnlyDictionary? cultureInfos)
+ // Scheduled for removal in V11
+ [Obsolete("Use ctor with all params, as the pros should be immutable")]
+ public ContentData()
+ {
+ Name = string.Empty;
+ UrlSegment = string.Empty;
+ Properties = null!;
+ CultureInfos = null!;
+ }
+
+ public ContentData(
+ string? name,
+ string? urlSegment,
+ int versionId,
+ DateTime versionDate,
+ int writerId,
+ int? templateId,
+ bool published,
+ IDictionary? properties,
+ IReadOnlyDictionary? cultureInfos)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
UrlSegment = urlSegment;
@@ -18,19 +37,69 @@ public class ContentData
CultureInfos = cultureInfos;
}
- public string Name { get; }
- public string? UrlSegment { get; }
- public int VersionId { get; }
- public DateTime VersionDate { get; }
- public int WriterId { get; }
- public int? TemplateId { get; }
- public bool Published { get; }
+ public string Name
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
- public IDictionary Properties { get; }
+ public string? UrlSegment
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
+
+ public int VersionId
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
+
+ public DateTime VersionDate
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
+
+ public int WriterId
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
+
+ public int? TemplateId
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
+
+ public bool Published
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
+
+ public IDictionary Properties
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
///
- /// The collection of language Id to name for the content item
+ /// The collection of language Id to name for the content item
///
- public IReadOnlyDictionary? CultureInfos { get; }
+ public IReadOnlyDictionary? CultureInfos
+ {
+ get;
+ [Obsolete("Do not change this, use ctor with params and have this object immutable.")]
+ set;
+ }
}
-
diff --git a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj
index 4a2f763d36..0eb68b99fe 100644
--- a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj
+++ b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj
@@ -1,7 +1,7 @@
- net7.0
+ net6.0
Umbraco.Cms.Infrastructure.PublishedCache
Umbraco.Cms.PublishedCache.NuCache
Umbraco CMS Published Cache
@@ -18,7 +18,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
index 7704344d4e..390482276e 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
@@ -186,13 +186,11 @@ public class AuthenticationController : UmbracoApiControllerBase
[ValidateAngularAntiForgeryToken]
public async Task PostUnLinkLogin(UnLinkLoginModel unlinkLoginModel)
{
- var userId = User.Identity?.GetUserId();
- if (userId is null)
+ BackOfficeIdentityUser? user = await _userManager.FindByIdAsync(User.Identity?.GetUserId());
+ if (user == null)
{
- throw new InvalidOperationException("Could not find userId");
+ throw new InvalidOperationException("Could not find user");
}
- var user = await _userManager.FindByIdAsync(userId);
- if (user == null) throw new InvalidOperationException("Could not find user");
AuthenticationScheme? authType = (await _signInManager.GetExternalAuthenticationSchemesAsync())
.FirstOrDefault(x => x.Name == unlinkLoginModel.LoginProvider);
@@ -486,19 +484,16 @@ public class AuthenticationController : UmbracoApiControllerBase
UmbracoUserExtensions.GetUserCulture(user.Culture, _textService, _globalSettings),
new[] { code });
- if (provider == "Email")
- {
- var mailMessage = new EmailMessage(from, user.Email, subject, message, true);
- await _emailSender.SendAsync(mailMessage, Constants.Web.EmailTypes.TwoFactorAuth);
- }
- else if (provider == "Phone")
- {
- var phoneNumber = await _userManager.GetPhoneNumberAsync(user);
- if (phoneNumber is not null)
- {
- await _smsSender.SendSmsAsync(phoneNumber, message);
- }
- }
+ if (provider == "Email")
+ {
+ var mailMessage = new EmailMessage(from, user.Email, subject, message, true);
+
+ await _emailSender.SendAsync(mailMessage, Constants.Web.EmailTypes.TwoFactorAuth);
+ }
+ else if (provider == "Phone")
+ {
+ await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message);
+ }
return Ok();
}
@@ -549,10 +544,6 @@ public class AuthenticationController : UmbracoApiControllerBase
{
BackOfficeIdentityUser? identityUser =
await _userManager.FindByIdAsync(model.UserId.ToString(CultureInfo.InvariantCulture));
- if (identityUser is null)
- {
- return new ValidationErrorResult("Could not find user");
- }
IdentityResult result = await _userManager.ResetPasswordAsync(identityUser, model.ResetCode, model.Password);
if (result.Succeeded)
diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
index ae0b9c961f..beee83cbb4 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
@@ -24,7 +24,6 @@ using Umbraco.Cms.Core.WebAssets;
using Umbraco.Cms.Infrastructure.WebAssets;
using Umbraco.Cms.Web.BackOffice.ActionResults;
using Umbraco.Cms.Web.BackOffice.Filters;
-using Umbraco.Cms.Web.BackOffice.Install;
using Umbraco.Cms.Web.BackOffice.Security;
using Umbraco.Cms.Web.Common.ActionsResults;
using Umbraco.Cms.Web.Common.Attributes;
@@ -212,12 +211,6 @@ public class BackOfficeController : UmbracoController
{
// force authentication to occur since this is not an authorized endpoint
AuthenticateResult result = await this.AuthenticateBackOfficeAsync();
- if (result.Succeeded)
- {
- // Redirect to installer if we're already authorized
- var installerUrl = Url.Action(nameof(InstallController.Index), ControllerExtensions.GetControllerName(), new { area = Cms.Core.Constants.Web.Mvc.InstallArea }) ?? "/";
- return new LocalRedirectResult(installerUrl);
- }
var viewPath = Path.Combine(Constants.SystemDirectories.Umbraco, Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml");
@@ -386,7 +379,7 @@ public class BackOfficeController : UmbracoController
[HttpGet]
public async Task ExternalLinkLoginCallback()
{
- BackOfficeIdentityUser? user = await _userManager.GetUserAsync(User);
+ BackOfficeIdentityUser user = await _userManager.GetUserAsync(User);
if (user == null)
{
// ... this should really not happen
@@ -504,8 +497,9 @@ public class BackOfficeController : UmbracoController
}
else if (result == SignInResult.TwoFactorRequired)
{
- BackOfficeIdentityUser? attemptedUser = await _userManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey);
- if (attemptedUser?.UserName is null)
+ BackOfficeIdentityUser? attemptedUser =
+ await _userManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey);
+ if (attemptedUser == null)
{
return new ValidationErrorResult(
$"No local user found for the login provider {loginInfo.LoginProvider} - {loginInfo.ProviderKey}");
diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
index c8a3c710ec..15deef1ad2 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
@@ -376,7 +376,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
},
{
"currentUserApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl(
- controller => controller.PostSetAvatar(new List()))
+ controller => controller.PostChangePassword(new ChangingPasswordModel()))
},
{
"entityApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl(
@@ -416,7 +416,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
},
{
"memberTypeApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl(
- controller => controller.GetById(0))
+ controller => controller.GetAllTypes())
},
{
"memberTypeQueryApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl(
@@ -569,7 +569,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
{"minimumPasswordNonAlphaNum", _memberPasswordConfigurationSettings.GetMinNonAlphaNumericChars()},
{"sanitizeTinyMce", _globalSettings.SanitizeTinyMce},
{"dataTypesCanBeChanged", _dataTypesSettings.CanBeChanged.ToString()},
- {"allowEditInvariantFromNonDefault", _contentSettings.AllowEditInvariantFromNonDefault},
+ {"allowEditInvariantFromNonDefault", _securitySettings.AllowEditInvariantFromNonDefault},
}
},
{
diff --git a/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs b/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
index 87f881ff69..f867ccc5a1 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
@@ -81,15 +81,47 @@ public class CurrentUserController : UmbracoAuthorizedJsonController
_userDataService = userDataService;
}
- ///
- /// Returns permissions for all nodes passed in for the current user
- ///
- ///
- ///
- [HttpPost]
- public Dictionary GetPermissions(int[] nodeIds)
- {
- EntityPermissionCollection permissions = _userService
+ [Obsolete("This constructor is obsolete and will be removed in v11, use constructor with all values")]
+ public CurrentUserController(
+ MediaFileManager mediaFileManager,
+ IOptions contentSettings,
+ IHostingEnvironment hostingEnvironment,
+ IImageUrlGenerator imageUrlGenerator,
+ IBackOfficeSecurityAccessor backofficeSecurityAccessor,
+ IUserService userService,
+ IUmbracoMapper umbracoMapper,
+ IBackOfficeUserManager backOfficeUserManager,
+ ILoggerFactory loggerFactory,
+ ILocalizedTextService localizedTextService,
+ AppCaches appCaches,
+ IShortStringHelper shortStringHelper,
+ IPasswordChanger passwordChanger) : this(
+ mediaFileManager,
+ StaticServiceProvider.Instance.GetRequiredService>(),
+ hostingEnvironment,
+ imageUrlGenerator,
+ backofficeSecurityAccessor,
+ userService,
+ umbracoMapper,
+ backOfficeUserManager,
+ localizedTextService,
+ appCaches,
+ shortStringHelper,
+ passwordChanger,
+ StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
+
+ ///
+ /// Returns permissions for all nodes passed in for the current user
+ ///
+ ///
+ ///
+ [HttpPost]
+ public Dictionary GetPermissions(int[] nodeIds)
+ {
+ EntityPermissionCollection permissions = _userService
.GetPermissions(_backofficeSecurityAccessor.BackOfficeSecurity?.CurrentUser, nodeIds);
var permissionsDictionary = new Dictionary();
@@ -198,13 +230,12 @@ public class CurrentUserController : UmbracoAuthorizedJsonController
[AllowAnonymous]
public async Task> PostSetInvitedUserPassword([FromBody] string newPassword)
{
- var userId = _backofficeSecurityAccessor.BackOfficeSecurity?.GetUserId().ResultOr(0).ToString();
- if (userId is null)
+ BackOfficeIdentityUser? user = await _backOfficeUserManager.FindByIdAsync(_backofficeSecurityAccessor
+ .BackOfficeSecurity?.GetUserId().ResultOr(0).ToString());
+ if (user == null)
{
- throw new InvalidOperationException("Could not find user Id");
+ throw new InvalidOperationException("Could not find user");
}
- var user = await _backOfficeUserManager.FindByIdAsync(userId);
- if (user == null) throw new InvalidOperationException("Could not find user");
IdentityResult result = await _backOfficeUserManager.AddPasswordAsync(user, newPassword);
@@ -304,18 +335,8 @@ public class CurrentUserController : UmbracoAuthorizedJsonController
[ValidateAngularAntiForgeryToken]
public async Task> GetCurrentUserLinkedLogins()
{
- var userId = _backofficeSecurityAccessor.BackOfficeSecurity?.GetUserId().ResultOr(0).ToString(CultureInfo.InvariantCulture);
- if (userId is null)
- {
- throw new InvalidOperationException("Could not find user Id");
- }
-
- BackOfficeIdentityUser? identityUser = await _backOfficeUserManager.FindByIdAsync(userId);
-
- if (identityUser is null)
- {
- throw new InvalidOperationException("Could not find user");
- }
+ BackOfficeIdentityUser identityUser = await _backOfficeUserManager.FindByIdAsync(_backofficeSecurityAccessor
+ .BackOfficeSecurity?.GetUserId().ResultOr(0).ToString(CultureInfo.InvariantCulture));
// deduplicate in case there are duplicates (there shouldn't be now since we have a unique constraint on the external logins
// but there didn't used to be)
diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
index ba9809f657..92779c18fa 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
@@ -471,6 +471,46 @@ public class EntityController : UmbracoAuthorizedJsonController
.Select(id => new { Id = id, Url = MediaOrDocumentUrl(id) }).ToDictionary(x => x.Id, x => x.Url);
}
+ ///
+ /// Get entity URLs by UDIs
+ ///
+ ///
+ /// A list of UDIs to lookup items by
+ ///
+ /// The culture to fetch the URL for
+ /// Dictionary mapping Udi -> Url
+ ///
+ /// We allow for POST because there could be quite a lot of Ids.
+ ///
+ [HttpGet]
+ [HttpPost]
+ [Obsolete("Use GetUrlsByIds instead.")]
+ public IDictionary GetUrlsByUdis([FromJsonPath] Udi[] udis, string? culture = null)
+ {
+ if (udis == null || !udis.Any())
+ {
+ return new Dictionary();
+ }
+
+ var udiEntityType = udis.First().EntityType;
+ UmbracoEntityTypes entityType;
+
+ switch (udiEntityType)
+ {
+ case Constants.UdiEntityType.Document:
+ entityType = UmbracoEntityTypes.Document;
+ break;
+ case Constants.UdiEntityType.Media:
+ entityType = UmbracoEntityTypes.Media;
+ break;
+ default:
+ entityType = (UmbracoEntityTypes)(-1);
+ break;
+ }
+
+ return GetUrlsByIds(udis, entityType, culture);
+ }
+
///
/// Gets the URL of an entity
///
diff --git a/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs b/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs
index 8dd599be46..6cb7f1f4bc 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs
@@ -18,6 +18,12 @@ public class HelpController : UmbracoAuthorizedJsonController
private readonly ILogger _logger;
private HelpPageSettings? _helpPageSettings;
+ [Obsolete("Use constructor that takes IOptions")]
+ public HelpController(ILogger logger)
+ : this(logger, StaticServiceProvider.Instance.GetRequiredService>())
+ {
+ }
+
[ActivatorUtilitiesConstructor]
public HelpController(
ILogger logger,
diff --git a/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs b/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs
index 4cb7dc52fc..bb515b61fc 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs
@@ -30,13 +30,21 @@ public class LanguageController : UmbracoAuthorizedJsonController
_umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));
}
- ///
- /// Returns all cultures available for creating languages.
- ///
- ///
- [HttpGet]
- public IDictionary GetAllCultures()
- => CultureInfo.GetCultures(CultureTypes.AllCultures).DistinctBy(x => x.Name).OrderBy(x => x.EnglishName).ToDictionary(x => x.Name, x => x.EnglishName);
+ [Obsolete("Use the constructor without global settings instead, scheduled for removal in V11.")]
+ public LanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper,
+ IOptionsSnapshot globalSettings)
+ : this(localizationService, umbracoMapper)
+ {
+ }
+
+ ///
+ /// Returns all cultures available for creating languages.
+ ///
+ ///
+ [HttpGet]
+ public IDictionary GetAllCultures()
+ => CultureInfo.GetCultures(CultureTypes.AllCultures).DistinctBy(x => x.Name).OrderBy(x => x.EnglishName)
+ .ToDictionary(x => x.Name, x => x.EnglishName);
///
/// Returns all currently configured languages.
diff --git a/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs b/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs
index 7389af5112..4c3cce59a5 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/LogViewerController.cs
@@ -22,6 +22,12 @@ public class LogViewerController : BackOfficeNotificationsController
private readonly ILogLevelLoader _logLevelLoader;
private readonly ILogViewer _logViewer;
+ [Obsolete]
+ public LogViewerController(ILogViewer logViewer)
+ : this(logViewer, StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
[ActivatorUtilitiesConstructor]
public LogViewerController(ILogViewer logViewer, ILogLevelLoader logLevelLoader)
{
@@ -141,4 +147,8 @@ public class LogViewerController : BackOfficeNotificationsController
[HttpGet]
public ReadOnlyDictionary GetLogLevels() => _logLevelLoader.GetLogLevelsFromSinks();
+
+ [Obsolete("Please use GetLogLevels() instead. Scheduled for removal in V11.")]
+ [HttpGet]
+ public string GetLogLevel() => _logViewer.GetLogLevel();
}
diff --git a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
index b81d120295..50c54f420f 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
@@ -986,6 +986,37 @@ public class MediaController : ContentControllerBase
return new ActionResult(toMove);
}
+ [Obsolete(
+ "Please use TrackedReferencesController.GetPagedRelationsForItem() instead. Scheduled for removal in V11.")]
+ public PagedResult GetPagedReferences(int id, string entityType, int pageNumber = 1,
+ int pageSize = 100)
+ {
+ if (pageNumber <= 0 || pageSize <= 0)
+ {
+ throw new NotSupportedException("Both pageNumber and pageSize must be greater than zero");
+ }
+
+ UmbracoObjectTypes objectType = ObjectTypes.GetUmbracoObjectType(entityType);
+ var udiType = objectType.GetUdiType();
+
+ IEnumerable relations =
+ _relationService.GetPagedParentEntitiesByChildId(id, pageNumber - 1, pageSize, out var totalRecords,
+ objectType);
+
+ return new PagedResult(totalRecords, pageNumber, pageSize)
+ {
+ Items = relations.Cast().Select(rel => new EntityBasic
+ {
+ Id = rel.Id,
+ Key = rel.Key,
+ Udi = Udi.Create(udiType, rel.Key),
+ Icon = rel.ContentTypeIcon,
+ Name = rel.Name,
+ Alias = rel.ContentTypeAlias
+ })
+ };
+ }
+
#region GetChildren
private int[]? _userStartNodes;
diff --git a/src/Umbraco.Web.BackOffice/Controllers/MemberController.cs b/src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
index b7220a3941..70f337f44f 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
@@ -367,7 +367,7 @@ public class MemberController : ContentControllerBase
contentItem.IsApproved,
contentItem.Name);
- IdentityResult created = await _memberManager.CreateAsync(identityMember, contentItem.Password?.NewPassword!);
+ IdentityResult created = await _memberManager.CreateAsync(identityMember, contentItem.Password?.NewPassword);
if (created.Succeeded == false)
{
@@ -513,12 +513,8 @@ public class MemberController : ContentControllerBase
}
var needsResync = false;
- var memberId = contentItem.Id?.ToString();
- if (memberId is null)
- {
- return ValidationProblem("Member was not found");
- }
- MemberIdentityUser? identityMember = await _memberManager.FindByIdAsync(memberId);
+
+ MemberIdentityUser identityMember = await _memberManager.FindByIdAsync(contentItem.Id?.ToString());
if (identityMember == null)
{
return ValidationProblem("Member was not found");
diff --git a/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs b/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs
index 4184cc5798..984cff0582 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/MemberTypeController.cs
@@ -183,6 +183,17 @@ public class MemberTypeController : ContentTypeControllerBase
return dto;
}
+
+ ///
+ /// Returns all member types
+ ///
+ [Obsolete(
+ "Use MemberTypeQueryController.GetAllTypes instead as it only requires AuthorizationPolicies.TreeAccessMembersOrMemberTypes and not both this and AuthorizationPolicies.TreeAccessMemberTypes")]
+ [Authorize(Policy = AuthorizationPolicies.TreeAccessMembersOrMemberTypes)]
+ public IEnumerable GetAllTypes() =>
+ _memberTypeService.GetAll()
+ .Select(_umbracoMapper.Map).WhereNotNull();
+
public ActionResult PostSave(MemberTypeSave contentTypeSave)
{
//get the persisted member type
diff --git a/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs b/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs
index 6a4e7ca236..be57a93328 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs
@@ -39,14 +39,23 @@ public class TemplateController : BackOfficeNotificationsController
throw new ArgumentNullException(nameof(defaultViewContentProvider));
}
- ///
- /// Gets data type by alias
- ///
- ///
- ///
- public TemplateDisplay? GetByAlias(string alias)
- {
- ITemplate? template = _fileService.GetTemplate(alias);
+ [Obsolete("Use ctor will all params")]
+ public TemplateController(
+ IFileService fileService,
+ IUmbracoMapper umbracoMapper,
+ IShortStringHelper shortStringHelper)
+ : this(fileService, umbracoMapper, shortStringHelper, StaticServiceProvider.Instance.GetRequiredService())
+ {
+ }
+
+ ///
+ /// Gets data type by alias
+ ///
+ ///
+ ///
+ public TemplateDisplay? GetByAlias(string alias)
+ {
+ ITemplate? template = _fileService.GetTemplate(alias);
return template == null ? null : _umbracoMapper.Map(template);
}
diff --git a/src/Umbraco.Web.BackOffice/Controllers/TinyMceController.cs b/src/Umbraco.Web.BackOffice/Controllers/TinyMceController.cs
index 3d93f9af6c..316073d8de 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/TinyMceController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/TinyMceController.cs
@@ -45,7 +45,7 @@ public class TinyMceController : UmbracoAuthorizedApiController
{
// Create an unique folder path to help with concurrent users to avoid filename clash
var imageTempPath =
- _hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.TempImageUploads + "/" + Guid.NewGuid());
+ _hostingEnvironment.MapPathWebRoot(Constants.SystemDirectories.TempImageUploads + "/" + Guid.NewGuid());
// Ensure image temp path exists
if (Directory.Exists(imageTempPath) == false)
@@ -81,7 +81,7 @@ public class TinyMceController : UmbracoAuthorizedApiController
}
var newFilePath = imageTempPath + Path.DirectorySeparatorChar + safeFileName;
- var relativeNewFilePath = GetRelativePath(newFilePath);
+ var relativeNewFilePath = _ioHelper.GetRelativePath(newFilePath);
await using (FileStream stream = System.IO.File.Create(newFilePath))
{
@@ -90,17 +90,4 @@ public class TinyMceController : UmbracoAuthorizedApiController
return Ok(new { tmpLocation = relativeNewFilePath });
}
-
- // Use private method istead of _ioHelper.GetRelativePath as that is relative for the webroot and not the content root.
- private string GetRelativePath(string path)
- {
- if (path.IsFullPath())
- {
- var rootDirectory = _hostingEnvironment.MapPathContentRoot("~");
- var relativePath = _ioHelper.PathStartsWith(path, rootDirectory) ? path[rootDirectory.Length..] : path;
- path = relativePath;
- }
-
- return PathUtility.EnsurePathIsApplicationRootPrefixed(path);
- }
}
diff --git a/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs b/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs
index 68a8773362..b0e081e9de 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/TwoFactorLoginController.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -23,7 +23,7 @@ public class TwoFactorLoginController : UmbracoAuthorizedJsonController
private readonly IBackOfficeSignInManager _backOfficeSignInManager;
private readonly IBackOfficeUserManager _backOfficeUserManager;
private readonly ILogger _logger;
- private readonly ITwoFactorLoginService _twoFactorLoginService;
+ private readonly ITwoFactorLoginService2 _twoFactorLoginService;
private readonly IOptionsSnapshot _twoFactorLoginViewOptions;
public TwoFactorLoginController(
@@ -36,7 +36,15 @@ public class TwoFactorLoginController : UmbracoAuthorizedJsonController
{
_backOfficeSecurityAccessor = backOfficeSecurityAccessor;
_logger = logger;
- _twoFactorLoginService = twoFactorLoginService;
+
+ if (twoFactorLoginService is not ITwoFactorLoginService2 twoFactorLoginService2)
+ {
+ throw new ArgumentException(
+ "twoFactorLoginService needs to implement ITwoFactorLoginService2 until the interfaces are merged",
+ nameof(twoFactorLoginService));
+ }
+
+ _twoFactorLoginService = twoFactorLoginService2;
_backOfficeSignInManager = backOfficeSignInManager;
_backOfficeUserManager = backOfficeUserManager;
_twoFactorLoginViewOptions = twoFactorLoginViewOptions;
@@ -65,11 +73,7 @@ public class TwoFactorLoginController : UmbracoAuthorizedJsonController
[HttpGet]
public async Task>> Get2FAProvidersForUser(int userId)
{
- BackOfficeIdentityUser? user = await _backOfficeUserManager.FindByIdAsync(userId.ToString(CultureInfo.InvariantCulture));
- if (user is null)
- {
- throw new InvalidOperationException("Could not find user");
- }
+ BackOfficeIdentityUser user = await _backOfficeUserManager.FindByIdAsync(userId.ToString(CultureInfo.InvariantCulture));
var enabledProviderNameHashSet =
new HashSet(await _twoFactorLoginService.GetEnabledTwoFactorProviderNamesAsync(user.Key));
diff --git a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
index 916ff3d495..f734d8626b 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
@@ -565,20 +565,10 @@ public class UsersController : BackOfficeNotificationsController
return new ActionResult(user);
}
- private async Task SendUserInviteEmailAsync(UserBasic? userDisplay, string? from, string? fromEmail, IUser? to, string? message)
+ private async Task SendUserInviteEmailAsync(UserBasic? userDisplay, string? from, string? fromEmail, IUser? to,
+ string? message)
{
- var userId = userDisplay?.Id?.ToString();
- if (userId is null)
- {
- throw new InvalidOperationException("Could not find user Id");
- }
- var user = await _userManager.FindByIdAsync(userId);
-
- if (user is null)
- {
- throw new InvalidOperationException("Could not find user");
- }
-
+ BackOfficeIdentityUser user = await _userManager.FindByIdAsync(((int?)userDisplay?.Id).ToString());
var token = await _userManager.GenerateEmailConfirmationTokenAsync(user);
// Use info from SMTP Settings if configured, otherwise set fromEmail as fallback
diff --git a/src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.LocalizedText.cs b/src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.LocalizedText.cs
index 9d677bce66..54e25240e0 100644
--- a/src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.LocalizedText.cs
+++ b/src/Umbraco.Web.BackOffice/DependencyInjection/UmbracoBuilder.LocalizedText.cs
@@ -48,7 +48,7 @@ namespace Umbraco.Extensions
IEnumerable userLangFileSources = contentFileProvider.GetDirectoryContents(userConfigLangFolder)
.Where(x => x.IsDirectory && x.Name.InvariantEquals("lang"))
- .Select(x => new DirectoryInfo(x.PhysicalPath!))
+ .Select(x => new DirectoryInfo(x.PhysicalPath))
.SelectMany(x => x.GetFiles("*.user.xml", SearchOption.TopDirectoryOnly))
.Select(x => new LocalizedTextServiceSupplementaryFileSource(x, true));
@@ -87,7 +87,7 @@ namespace Umbraco.Extensions
.GetDirectoryContents(langFolder)
.Where(x => !string.IsNullOrEmpty(x.PhysicalPath))
.Where(x => x.Name.InvariantEndsWith(".xml"))
- .Select(x => new FileInfo(x.PhysicalPath!));
+ .Select(x => new FileInfo(x.PhysicalPath));
foreach (FileInfo file in localizationFiles)
{
diff --git a/src/Umbraco.Web.BackOffice/Install/CreateUnattendedUserNotificationHandler.cs b/src/Umbraco.Web.BackOffice/Install/CreateUnattendedUserNotificationHandler.cs
index 1ac7f20819..13896c8912 100644
--- a/src/Umbraco.Web.BackOffice/Install/CreateUnattendedUserNotificationHandler.cs
+++ b/src/Umbraco.Web.BackOffice/Install/CreateUnattendedUserNotificationHandler.cs
@@ -75,7 +75,7 @@ public class CreateUnattendedUserNotificationHandler : INotificationAsyncHandler
using IServiceScope scope = _serviceScopeFactory.CreateScope();
IBackOfficeUserManager backOfficeUserManager =
scope.ServiceProvider.GetRequiredService();
- BackOfficeIdentityUser? membershipUser =
+ BackOfficeIdentityUser membershipUser =
await backOfficeUserManager.FindByIdAsync(Constants.Security.SuperUserIdAsString);
if (membershipUser == null)
{
diff --git a/src/Umbraco.Web.BackOffice/Install/InstallApiController.cs b/src/Umbraco.Web.BackOffice/Install/InstallApiController.cs
index 52068c6f8d..e5f1c4fc36 100644
--- a/src/Umbraco.Web.BackOffice/Install/InstallApiController.cs
+++ b/src/Umbraco.Web.BackOffice/Install/InstallApiController.cs
@@ -60,27 +60,26 @@ public class InstallApiController : ControllerBase
internal InstallHelper InstallHelper { get; }
public bool PostValidateDatabaseConnection(DatabaseModel databaseSettings)
- {
- if (_runtime.State.Level != RuntimeLevel.Install)
- {
- return false;
- }
-
- return _databaseBuilder.ConfigureDatabaseConnection(databaseSettings, true);
- }
+ => _databaseBuilder.ConfigureDatabaseConnection(databaseSettings, true);
///
- /// Gets the install setup.
+ /// Gets the install setup.
///
public InstallSetup GetSetup()
{
- // Only get the steps that are targeting the current install type
- var setup = new InstallSetup
- {
- Steps = _installSteps.GetStepsForCurrentInstallType().ToList()
- };
+ var setup = new InstallSetup();
- _installStatusTracker.Initialize(setup.InstallId, setup.Steps);
+ // TODO: Check for user/site token
+
+ var steps = new List();
+
+ InstallSetupStep[] installSteps = _installSteps.GetStepsForCurrentInstallType().ToArray();
+
+ //only get the steps that are targeting the current install type
+ steps.AddRange(installSteps);
+ setup.Steps = steps;
+
+ _installStatusTracker.Initialize(setup.InstallId, installSteps);
return setup;
}
@@ -88,23 +87,18 @@ public class InstallApiController : ControllerBase
[HttpPost]
public async Task CompleteInstall()
{
- RuntimeLevel levelBeforeRestart = _runtime.State.Level;
-
await _runtime.RestartAsync();
- if (levelBeforeRestart == RuntimeLevel.Install)
- {
- BackOfficeIdentityUser? identityUser =
- await _backOfficeUserManager.FindByIdAsync(Core.Constants.Security.SuperUserIdAsString);
- if (identityUser is not null)
- {
- _backOfficeSignInManager.SignInAsync(identityUser, false);
- }
- }
+ BackOfficeIdentityUser identityUser =
+ await _backOfficeUserManager.FindByIdAsync(Constants.Security.SuperUserIdAsString);
+ _backOfficeSignInManager.SignInAsync(identityUser, false);
return NoContent();
}
+ ///
+ /// Installs.
+ ///
public async Task> PostPerformInstall(InstallInstructions installModel)
{
if (installModel == null)
@@ -112,14 +106,14 @@ public class InstallApiController : ControllerBase
throw new ArgumentNullException(nameof(installModel));
}
- // There won't be any statuses returned if the app pool has restarted so we need to re-read from file
InstallTrackingItem[] status = InstallStatusTracker.GetStatus().ToArray();
+ //there won't be any statuses returned if the app pool has restarted so we need to re-read from file.
if (status.Any() == false)
{
status = _installStatusTracker.InitializeFromFile(installModel.InstallId).ToArray();
}
- // Create a new queue of the non-finished ones
+ //create a new queue of the non-finished ones
var queue = new Queue(status.Where(x => x.IsComplete == false));
while (queue.Count > 0)
{
@@ -146,15 +140,14 @@ public class InstallApiController : ControllerBase
// determine's the next step in the queue and dequeue's any items that don't need to execute
var nextStep = IterateSteps(step, queue, installModel.InstallId, installModel);
- bool processComplete = string.IsNullOrEmpty(nextStep) && InstallStatusTracker.GetStatus().All(x => x.IsComplete);
// check if there's a custom view to return for this step
if (setupData != null && setupData.View.IsNullOrWhiteSpace() == false)
{
- return new InstallProgressResultModel(processComplete, step.Name, nextStep, setupData.View, setupData.ViewModel);
+ return new InstallProgressResultModel(false, step.Name, nextStep, setupData.View, setupData.ViewModel);
}
- return new InstallProgressResultModel(processComplete, step.Name, nextStep);
+ return new InstallProgressResultModel(false, step.Name, nextStep);
}
catch (Exception ex)
{
@@ -255,7 +248,8 @@ public class InstallApiController : ControllerBase
Attempt modelAttempt = instruction.TryConvertTo(step.StepType);
if (!modelAttempt.Success)
{
- throw new InvalidCastException($"Cannot cast/convert {step.GetType().FullName} into {step.StepType.FullName}");
+ throw new InvalidCastException(
+ $"Cannot cast/convert {step.GetType().FullName} into {step.StepType.FullName}");
}
var model = modelAttempt.Result;
@@ -283,7 +277,8 @@ public class InstallApiController : ControllerBase
Attempt modelAttempt = instruction.TryConvertTo(step.StepType);
if (!modelAttempt.Success)
{
- throw new InvalidCastException($"Cannot cast/convert {step.GetType().FullName} into {step.StepType.FullName}");
+ throw new InvalidCastException(
+ $"Cannot cast/convert {step.GetType().FullName} into {step.StepType.FullName}");
}
var model = modelAttempt.Result;
diff --git a/src/Umbraco.Web.BackOffice/Install/InstallAreaRoutes.cs b/src/Umbraco.Web.BackOffice/Install/InstallAreaRoutes.cs
index 0ea55d861d..590fb73e0e 100644
--- a/src/Umbraco.Web.BackOffice/Install/InstallAreaRoutes.cs
+++ b/src/Umbraco.Web.BackOffice/Install/InstallAreaRoutes.cs
@@ -29,14 +29,21 @@ public class InstallAreaRoutes : IAreaRoutes
switch (_runtime.Level)
{
case var _ when _runtime.EnableInstaller():
- endpoints.MapUmbracoRoute(installPathSegment, Constants.Web.Mvc.InstallArea, "api", includeControllerNameInRoute: false);
- endpoints.MapUmbracoRoute(installPathSegment, Constants.Web.Mvc.InstallArea, string.Empty, includeControllerNameInRoute: false);
- // register catch all because if we are in install/upgrade mode then we'll catch everything
- endpoints.MapFallbackToAreaController(nameof(InstallController.Index), ControllerExtensions.GetControllerName(), Constants.Web.Mvc.InstallArea);
+ endpoints.MapUmbracoRoute(installPathSegment, Constants.Web.Mvc.InstallArea,
+ "api", includeControllerNameInRoute: false);
+ endpoints.MapUmbracoRoute