Commit Graph

682 Commits

Author SHA1 Message Date
Dirk Seefeld
4bf2fbf1ba Bugfix/19601 can not add ef core migrations (#19846)
* fix EFCore add migration issue

* update test

* Resolved breaking changes and code review comments.

* Removed extra line break.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-08-04 10:56:25 +00:00
Sven Geusens
a2cc6a0a87 Fix issue with use of EF Core scopes within notification handlers (take 2 - handling scopes with a base parent) (#19797)
* Add integration tests that shows the problem

* Fix the problem and add explenation

* Improved comments slightly to help when we come back here!
Moved tests alongside existing ones related to scopes.
Removed long running attribute from tests (they are quite fast).

* Fixed casing in comment.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-07-25 13:07:20 +02:00
Laura Neto
b722c0d72d Abstract submit and poll operations (#19688)
* Started implementing new LongRunningOperationService and adjusting tasks to use this service

This service will manage operations that require status to be synced between servers (load balanced setup).

* Missing migration to add new lock. Other simplifications.

* Add job to cleanup the LongRunningOperations entries

* Add new DatabaseCacheRebuilder.RebuildAsync method

This is both async and returns an attempt, which will fail if a rebuild operation is already running.

* Missing LongRunningOperation database table creation on clean install

* Store expire date in the long running operation. Better handling of non-background operations.

Storing an expiration date allows setting different expiration times depending on the type of operation, and whether it is running in the background or not.

* Added integration tests for LongRunningOperationRepository

* Added unit tests for LongRunningOperationService

* Add type as a parameter to more repository calls. Distinguish between expiration and deletion in `LongRunningOperationRepository.CleanOperations`.

* Fix failing unit test

* Fixed `PerformPublishBranchAsync` result not being deserialized correctly

* Remove unnecessary DatabaseCacheRebuildResult value

* Add status to `LongRunningOperationService.GetResult` attempt to inform on why a result could not be retrieved

* General improvements

* Missing rename

* Improve the handling of long running operations that are not in background and stale operations

* Fix failing unit tests

* Fixed small mismatch between interface and implementation

* Use a fire and forget task instead of the background queue

* Apply suggestions from code review

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Make sure exceptions are caught when running in the background

* Alignment with other repositories (async + pagination)

* Additional fixes

* Add Async suffix to service methods

* Missing adjustment

* Moved hardcoded settings to IOptions

* Fix issue in SQL Server where 0 is not accepted as requested number of rows

* Fix issue in SQL Server where query provided to count cannot contain orderby

* Additional SQL Server fixes

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-07-22 15:26:04 +02:00
Henrik
7f88013689 Make internal & private classes sealed where possible, to avoid code for virtual dispatch (#19719) 2025-07-21 08:32:54 +02:00
Kenn Jacobsen
5660c6c369 Forward merge #19720 to V16 (#19735)
* Add support for programmatic creation of property types providing the data type key (#19720)

* Add support for programmatic creation of property types providing the data type key.

* Add integration tests

---------

Co-authored-by: kjac <kja@umbraco.dk>

* Don't use Lazy

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-07-18 10:47:34 +02:00
Mole
9baf04026e V16: Siblings endpoints (#19657)
* PoC implementation

* Move to controller base

* Implement solution that seems worse, but works better

* Don't require parent key in repository method

* Fix typos

* Add siblings for data type, media type and media

* Add endpoint for template

* Add DocumentType and DocumentBlueprint controllers

* Fix naming

* Fix case if siblings are under root

* Take item ordering into account

not all entities are ordered by sort order

* Add default implementation

* Fix parentkey

* Add tests

* Format optimizations for split view

* Add test covered requirement to description

* Cover positive case and make test case output more readable

* reduce allocations

* Clarify test

---------

Co-authored-by: Migaroez <geusens@gmail.com>
2025-07-07 12:53:42 +00:00
Andy Butland
b5195ed8eb Fixes issues with creation of documents from blueprints that have populated file upload properties (#19655)
* Fixes issue where content created from blueprint would not persist file upload property values.

* Ensure a copy of a file upload is created when scaffolding content from a blueprint, like we do when copying content.

* Clarified comment.

* Removed unneeded usings.

* Fixed spelling.

* Handle create of blueprint from content to create a new uploaded file.
Handle delete of blueprint to delete uploaded files.
2025-07-07 14:15:17 +02:00
Andy Butland
4c87cc5fd9 Adds support for custom granular permissions when aggregating across user groups (#19660)
* Added abstraction for aggregation of granular permissions to support custom permissions.

* Refactor to move responsibility for aggregating granular permissions to the respective mappers.

* Added XML header comments for permission mappers.

* Tidied up/removed warnings in UserPresentationFactory interface and implementation.

* Optimized retrieval of documents in DocumentPermissionMapper.

* Fixed method header comment.

* Use entity service rather than content service to retrieve key and path.
2025-07-07 12:59:55 +02:00
Laura Neto
dcd8b42522 Move cache instructions pruning to background job (#19598)
* Remove pruning logic from `CacheInstructionService.ProcessInstructions()`

* Add and register `CacheInstructionsPruningJob` background job

* Add unit tests

* Remove breaking change in ICacheInstructionService

* Adjust some obsoletion messages to mention v17

* Added missing scope

* Update tests

* Fix obsoletion messages version

* Update ProcessInstructions methods summary
2025-07-01 11:17:59 +02:00
Brynjar Þorsteinsson
ad5a18f1ee Fix pagination in Content Delivery API Index Helper (#19606)
* Refactor descendant enumeration in DeliveryApiContentIndexHelper

Improved loop condition to allow for processing of more than 10.000 descendants for indexing.

* Add failing test for original issue.

* Renamed variable for clarity.

---------

Co-authored-by: Brynjar Þorsteinsson <brynjar@vettvangur.is>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-07-01 08:23:58 +02:00
Peter
14063a0b89 Add support for file upload property editor within the block list and grid (#18976)
* Fix for https://github.com/umbraco/Umbraco-CMS/issues/18872

* Parsing added for current value

* Build fix.

* Cyclomatic complexity fix

* Resolved breaking change.

* Pass content key.

* Simplified collections.

* Added unit tests to verify behaviour.

* Allow file upload on block list.

* Added unit test verifying added property.

* Added unit test verifying removed property.

* Restored null return for null value fixing failing integration tests.

* Logic has been updated according edge cases

* Logic to copy files from block list items has been added.

* Logic to delete files from block list items on content deletion has been added

* Test fix.

* Refactoring.

* WIP: Resolved breaking changes, minor refactoring.

* Consistently return null over empty, resolving failure in integration test.

* Removed unnecessary code nesting.

* Handle distinct paths.

* Handles clean up of files added via file upload in rich text blocks on delete of the content.

* Update src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs

Co-authored-by: Sven Geusens <geusens@gmail.com>

* Fixed build of integration tests project.

* Handled delete of file uploads when deleting a block from an RTE using a file upload property.

* Refactored ensure of property type property populated on rich text values to a common helper extension method.

* Fixed integration tests build.

* Handle create of new file from file upload block in an RTE when the document is copied.

* Fixed failing integration tests.

* Refactored notification handlers relating to file uploads into separate classes.

* Handle nested rich text editor block with file upload when copying content.

* Handle nested rich text editor block with file upload when deleting content.

* Minor refactor.

* Integration test compatibility supressions.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Sven Geusens <geusens@gmail.com>
2025-06-30 13:21:10 +02:00
Andy Butland
2cb114ffaf Fix check for pending package migration to use the package not the plan name (#19509)
* Fix check for pending package migration to use the package not plan name.

* Cover all package name/identifier permutations and fix the API output for multiple plans

* Adjusted log message to not refer to unattended migrations as migrations may be being run attended.

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-06-30 10:20:11 +00:00
Andy Butland
29b6c2d49e Assert dates in content editing integration tests to millisecond only (#19513)
* Assert dates in content editing integration tests to millisecond only.

* Add date time extension unit tests and refactor to switch statement.

* Removed whitespace.
2025-06-30 07:59:22 +02:00
Laura Neto
55506bac3a Simplify creating content from a blueprint programmatically (#19528)
* Rename `IContentService.CreateContentFromBlueprint` to `CreateBlueprintFromContent`

In reality, this method is used by the core to create a blueprint from content, and not the other way around, which doesn't need new ids. This was causing confusion, so the old name has been marked as deprecated in favor of the new name. If developers want to create content from blueprints they should use `IContentBlueprintEditingService.GetScaffoldedAsync()` instead, which is what is used by the management api.

* Added integration tests to verify that new block ids are generated when creating content from a blueprint

* Return copy of the blueprint in `ContentBlueprintEditingService.GetScaffoldedAsync` instead of the blueprint itself

* Update CreateContentFromBlueprint xml docs to mention both replacement methods

* Fix tests for rich text blocks

* Small re-organization

* Adjusted tests that were still referencing `ContentService.CreateContentFromBlueprint`

* Add default implementation to new CreateBlueprintFromContent method

* Update tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentBlueprintEditingServiceTests.GetScaffold.cs

Co-authored-by: Andy Butland <abutland73@gmail.com>

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-06-24 13:43:34 +02:00
Andy Butland
da9c6e24ce Removed unnecessary compatibility suppressions file from integration tests. 2025-06-12 13:50:29 +02:00
Sven Geusens
d2a0cba933 V16 cherry pick of member partial cache invalidator see #19314 (#19459)
* v16 cherry pick of member partial cache invalidator see #19314

# Resolved merge conflic in src/Umbraco.Core/Cache/Refreshers/Implement/MemberCacheRefresher.cs

* Take nullmember cacheitems into account
2025-06-02 14:52:38 +02:00
Andy Butland
fd3808ae38 Ensure tag operations are case insensitive on insert across database types (#19439)
* Ensure tag operations are case insensitve on insert across database types.

* Ensure tags provided in a single property are case insensitively distinct when saving the tags and relationships.

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TagRepository.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Handle case sensitivity on insert with tag groups too.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-30 10:00:25 +02:00
Andy Butland
b87ae6ce46 Fix issue with requests to delivery API by path where URL segment contains special characters (#19390) 2025-05-23 11:14:33 +02:00
Andreas Zerbst
6a032390c2 Merge remote-tracking branch 'origin/v15/dev' into v16/merge-15-to-16-release
# Conflicts:
#	Directory.Packages.props
#	build/nightly-E2E-test-pipelines.yml
#	src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI.Client/package.json
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/RichTextEditor/ContentWithTiptap.spec.ts
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Media/Media.spec.ts
#	version.json
2025-05-20 09:26:06 +02:00
Andy Butland
3f10bd8c21 Added logging and try/catch around retrieval of references, so we don't block critical operations following an incompatible data type change (#18576)
* Added logging and try/catch around retrieval of references, so we don't block critical operations following an incompatible data type change.

* Added a little more detail to the log message.

* Added a little more detail to the log message.

* Fix unittest mock dependency

---------

Co-authored-by: Migaroez <geusens@gmail.com>
2025-05-19 10:54:22 +02:00
Andy Butland
6fd6319b12 Ensures cultures set on content are correctly cased (#19290)
* Ensures cultures set on content are correctly cased and verifies with integration tests.

* Improved test comments.

* Move culture casing check into an extension method and use from content service.

* Deduplicated test code and added more test cases

* Only run invalid culture codes test on Windows

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-05-14 09:47:21 +02:00
Andy Butland
22e0720395 Log language ISO codes instead of language names (#19259) 2025-05-07 08:42:39 +02:00
Kenn Jacobsen
ae54b92005 Output culture variant update dates from the Delivery API (#19180) 2025-04-29 07:01:07 +02:00
Kenn Jacobsen
4f883b6714 Make culture specific update dates work again (#19145) 2025-04-27 08:26:15 +02:00
Sven Geusens
ba0dcfa773 Avoid hybrid cache usage when traversing unpublished ancestors in a published context (non preview) (#19137)
* Filter Available should not return items without published ancestors when not in preview

* Update unittests mocks

* Internal documentation and minor code tidy.

* Tidied up integration tests and added new tests for the added method.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-04-24 21:07:40 +02:00
mole
ef9a6e1821 Merge remote-tracking branch 'origin/v15/dev' into v16/dev 2025-04-24 13:19:21 +02:00
Andy Butland
b4528cf963 Fixed error with reflection on integration test configure builder attributes, so integration tests can be created outside of the Umbraco integration test project (#19077)
* Fixed error with reflection on integration test configure builder attributes, so integration tests can be created outside of the Umbraco integration test project.

* Fix nullability

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
2025-04-24 13:18:29 +02:00
Mole
cb1ec988ce V15: Ensure elements cache is cleared on subscribers in load balanced scenarios (#19128)
* Clear elementscache from cache refreshers

* Add very simple test ensuring the elements cache is cleared

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-04-24 13:15:30 +02:00
Sven Geusens
297ceaf0aa Remove fake null checks as they are no longer needed after merge into v16 (#19109) 2025-04-24 11:46:41 +02:00
Andy Butland
3dd32642e2 Updated server-side dependencies to latest versions for Umbraco 16 (#19117)
* Updated dependencies to latest versions.

* Fixed breaking changes following dependency updates.

* Limited NUnit updates to within the current major.

* Fixed failing delivery API contract integration test.
2025-04-23 20:05:41 +02:00
Andy Butland
024a450377 Added integration tests for publishing service with invalid content (#19095)
* Added integration tests for publishing service with invalid content.

* Amend test to new create/update models

---------

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2025-04-23 15:09:39 +00:00
Niels Lyngsø
b330395db0 Content Type inheritance (#19034)
* content type nesting

* TODOs

* repository detail manager

* todo

* implement unlimited compositions

* a little refactor

* warn

* clear state

* refactor to use unique

* note

* code corrections to match with types

* unique type for Array State

* implement usedForInheritance and editedTypes for Structure Manager and Compositions

* rename method

* Update repository-details.manager.ts

* avoid type casting

* align naming

* do not await

* fix race condition when switching document types fast

* remove test prop

* Update manifests.ts

* UmbMediaTypeWorkspaceContext Routes for inheritance

* import

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-04-23 15:05:32 +02:00
Kenn Jacobsen
2cf28271cd Service refactoring to "fully" enable segments (#19114)
* Refactor serverside content editing to support all variance combinations

* Fix build errors

* Reintroduce the tests ignored by #19060

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-04-23 14:54:51 +02:00
Niels Lyngsø
5b76d3bc04 Merge branch 'v16/dev' into v15/feature/select-segment 2025-04-23 09:32:21 +02:00
Kenn Jacobsen
64f1e17479 Segment support for the Delivery API (#19082)
* Segment support for the Delivery API

* Do not apply empty strings as variance.

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
2025-04-23 05:45:04 +00:00
Kenn Jacobsen
4a768b694e Merge branch 'v16/dev' into v15/feature/select-segment 2025-04-23 07:12:07 +02:00
Sven Geusens
c42237ecfa Remove fake null checks as they are no longer needed after merge into v16 (#19109) 2025-04-23 07:09:00 +02:00
kjac
8ef061b768 Ignore failing tests for now (will be fixed in a follow-up PR) 2025-04-22 14:13:43 +02:00
kjac
3521549ff3 Fix build errors 2025-04-22 14:10:45 +02:00
Kenn Jacobsen
548970a27f Merge branch 'v16/dev' into v15/feature/select-segment 2025-04-22 12:07:04 +02:00
Andy Butland
225f4d3e09 Merge remote-tracking branch 'origin/v15/dev' into v16/dev 2025-04-22 09:33:07 +02:00
Sven Geusens
c86a6fa8e5 V15/fix/sub variant block deletion (#18802)
* Fix

* Editors with access should be able to clear a blocklist value

* Writeup around block element level variation

* Dissallow values to be removed a limited language user does not have permissions to

* Remove commented out code

* improved comments

* Improve expose list for limited language access sub variant block lists
2025-04-21 10:30:12 +02:00
Niels Lyngsø
4561394283 Merge branch 'v16/dev' into v15/feature/select-segment 2025-04-16 18:05:26 +02:00
Jacob Overgaard
c63ed69ee2 Merge branch 'v15/dev' into v16/dev 2025-04-16 14:54:50 +02:00
Kenn Jacobsen
29c0151460 Scaffold content for content templates serverside (#19054)
* Scaffold content for content templates serverside

* Generated client types and methods from API.

* Retrieve scaffolded blueprint when creating documents from a blueprint.

* Use introduced helper method on existing read.

* Cleaned up imports.

* feat: moves scaffold service logic to data source and make shallow repository method

* feat: follows UmbDataSourceResponse interface and reorders public/private methods

* Bumped version to 15.4.0-r2.

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-04-16 12:39:07 +00:00
Mads Rasmussen
eddf06e773 Merge branch 'v16/dev' into v15/feature/select-segment 2025-04-16 09:29:28 +02:00
Kenn Jacobsen
96c0509719 Content search abstractions to facilitate new search in the backoffice (#19046) 2025-04-15 16:18:42 +02:00
Jacob Overgaard
dab3975d2e Merge branch 'v15/dev' into v16/dev 2025-04-15 14:47:51 +02:00
Kenn Jacobsen
7495c3c7b2 Treat content schedule dates as UTC (#19028) 2025-04-14 14:50:02 +02:00
Niels Lyngsø
16ee7227ae Feature: Document Property Value Permission (#18997)
* add property visibility state manager

* implement in structure manager

* filter properties based on visibility

* wip document type structure permissions

* rename

* register entity permission for document type property

* add entity permission for media type property

* pass fallback permissions to document granular permissions

* set as preset

* clean up

* wip document type property picker

* add preset value

* Update input-document-type-structure-granular-user-permission.element.ts

* move files

* rename

* Update input-document-value-granular-user-permission.element.ts

* remove temp test

* Update manifests.ts

* remove unused

* Update input-document-value-granular-user-permission.element.ts

* rename see permission + add write permission

* fix missing type

* require property type unique

* add unique to property type

* rename to property type

* map to unique

* deprecate id on property type

* return unique from property picker

* more explicit naming

* use type

* render detail

* Update input-document-value-granular-user-permission.element.ts

* wip modal flow

* clean up

* add headlines

* hide actions

* pass preset value

* add edit permission method

* include property in permission name

* add read and write managers

* implement read and write state managers

* Update content-type-structure-manager.class.ts

* enforce property permissions

* Storage for granular permissions at property type level

* add guards

* make variant property version

* Rename server models to include "property"

* generate server types

* add permissionType to model

* add mappers to user group permission data

* add mapper to current user permission data

* destroy

* clear state

* use permission type for guard check

* add permission type

* require specific permission type

* use correct schema type

* add mappings

* clean up

* log errors

* fix mapping

* null check for icon

* use fallback if there is no forDataModel

* add translations

* sort group alphabetically

* add empty state for no verbs

* organize folders

* always require unique and variant id

* Allow storing empty lists of verbs

* pass variant id to all states

* Remove empty verbs

* add alias to name

* prevent picking the same property type multiple times

* fix lint errors

* fix create state by observing variant options

* move to workspace context

* Update document-property-value-user-permission.workspace-context.ts

* Update content-editor-properties.element.ts

* clean up

* Rename models (last time, promise!)

* Add migration for default document property value permissions

* generate new server models

* update after model changes

* Correct the default permission identifiers

* Add default permissions to newly created DBs

* Add validation and clean-up

* rename to visibility state

* rename to view

* add helpers

* apply to blocks

* Update document-property-value-user-permission.workspace-context.ts

* disable view and write state by default

* add tests for start and stopping a state

* throw errors if adding to a state that is not running

* export consts

* export consts

* fix circular

* fix circular

* set the entity type when setting values

* only apply for block in document values

* split logic

* start states for document blocks

* only apply states when state is running

* Fixed typos in test method names.

* add readonly type

* Enforce: AllowEditInvariantFromNonDefault configuration (#18758)

* add read only state

* handle read only property state in properties element

* prevent editing shared props on non default

* enforce configuration

* clean up

* set variant id

* move to property module

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>

* remove unnecessary messages

* make sure to destroy consumer

* Thoughts as TODO

* use Entry type

* use Entry type

* get rid of things not yet released

* clean up

* use generic methods

* TODO comment

* use generic observable

* catch if not found

* move variant id out of property type

* mega refactor temp commit

* Guard Manager

* set readOnly as a property on property editors

* further rename

* remove property state managers

* revert state manager

* fix sorting rule

* mega rename and correction

* refactor properties elements

* todo note

* clean up

* impl

* mega refactor moving permission guards to workspace

* rename

* type change

* rearrange

* correct import

* fix tests

* correct tests

* reset viewGuards block

* type correction

* refactor read only for user permissions setting

* todo note

* align property element

* await promise

* impl view guard property filtering

* correct const name

* fix fallback user permissions in mock data

* correct property type id mock data

* toggle permissions example

* complex permission

* Move migration to 16.0.

* rename fallBackToDisallowed to fallbackToNotPermitted

* clean up setReadOnlyStateForUserPermission

* capital o

* align read only naming

* rename method

* add js docs

* remove unused

* correct method name

* add js docs

* add js docs

* camel case function

* fix eslint problems

* camelcase const

* align method names

* remove unused

* fix host

* fix spelling mistake

* align naming

* fix spelling mistake

* add alias

* use read only state methods

* camel case function

* correct method name

* add js docs

* camelcase function

* camel case function

* align method names

* change method name wording

* Include document property value permissions in the current user's aggregated permissions.

* use is read only

* delete unused

* fix implementation of AllowEditInvariantFromNonDefault

* don't know what is happening here. Local is it lower on github it is higher

* Update document-workspace.context.ts

* revert to v16 dev

* simplify if statement

* make it explicit that these are ui only permissions

* add action label for read

* remove duplicates

* use read instead of browse

* align description

* use document instead of node

* make the base class abstract

* extend in test

* Update guard.manager.base.test.ts

* fix example

* style adjustment

* group styling

* refactor guard rule resolving

* remove imports

* remove console.log

* improve disconnected context consumer rejection message

* fix publishableVariantsFilter

* Update document-workspace.context.ts

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-04-11 14:16:59 +02:00