Part of ContentService refactoring Phase 3.
Covers version retrieval, rollback, and version deletion.
Current status: 10/16 tests passing
- Core functionality tests pass (version retrieval, basic operations)
- 6 tests fail due to version creation behavior (requires investigation)
Known issues to address in follow-up:
- Multiple consecutive saves not creating separate versions
- Version deletion and rollback tests affected by version behavior
v1.1 fixes applied:
- Deterministic date comparison instead of Thread.Sleep (Issue 2.5)
- Added Rollback cancellation test (Issue 3.2)
- Added published version protection test (Issue 3.3)
v1.2 fixes applied:
- Fixed notification handler registration pattern (Issue 3.2)
- Fixed Publish method signature using ContentPublishingService (Issue 3.4)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
ContentService now delegates all paged type queries to the new
QueryOperationService, completing Phase 2 delegation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
ContentService.GetByLevel now delegates to QueryOperationService,
continuing Phase 2 query operation extraction.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
ContentService now delegates Count, CountPublished, CountChildren,
CountDescendants to the new QueryOperationService.
This is Task 5 of Phase 2 - the first delegation task that converts
ContentService from direct repository calls to delegating to the
specialized query operation service.
All tests pass. Baseline tests confirm facade and direct service
return identical results. Full ContentService test suite passes
(excluding pre-existing benchmark regressions).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements IContentQueryOperationService with Count, GetByLevel, and
GetPagedOfType operations. Follows Phase 1 patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The Create_WithNonExistentContentType test expected ArgumentException but
ContentCrudService correctly throws generic Exception to match the original
ContentService behavior (behavioral parity).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds IContentCrudService registration to UmbracoBuilder alongside
IContentService. Both services are now resolvable from DI.
Includes integration test verifying successful resolution.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements IContentCrudService with full CRUD operations:
- Create: 6 overloads matching IContentService
- Read: GetById, GetByIds, GetRootContent, GetParent
- Save: Single and batch with notifications
- Delete: Cascade deletion with notifications
All methods maintain exact behavioral parity with ContentService.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Establishes shared infrastructure for content services:
- Common dependencies (DocumentRepository, AuditService, UserIdKeyResolver)
- Audit helper methods (sync and async)
- Inherits from RepositoryService for scope/query support
- Adds ContentServiceConstants for shared constants (batch page size)
Updated tracking test to look for correct assembly location.
Tracking test now fails (expected) - signals class exists for future work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds unit test file for ContentServiceBase with documented test cases.
Tests are commented out until ContentServiceBase is created in Phase 1:
- 2 audit helper method tests
- 2 scope provider access pattern tests
- 2 logger injection tests
- 1 repository access test
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds 3 integration tests for transaction boundaries:
- Test 13: Nested operations in uncompleted scope roll back together
- Test 14: Completed scope commits all operations together
- Test 15: MoveToRecycleBin rolls back completely when scope not completed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds 4 integration tests for permission operations:
- Test 9: SetPermission assigns permission and GetPermissions retrieves it
- Test 10: Multiple SetPermission calls accumulate permissions
- Test 11: SetPermissions assigns complete permission set
- Test 12: SetPermission assigns to multiple user groups at once
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds 3 integration tests for DeleteOfType operations:
- Test 6: DeleteOfType handles descendants correctly (moves different types to bin)
- Test 7: DeleteOfType only deletes specified type, preserves others
- Test 8: DeleteOfTypes deletes multiple content types at once
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds 3 integration tests for Sort operations:
- Test 3: Sort(IEnumerable<IContent>) reorders children correctly
- Test 4: Sort(IEnumerable<int>) reorders children by ID correctly
- Test 5: Sort fires Sorting and Sorted notifications in sequence
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds the test file skeleton with notification handler infrastructure
for tracking notification ordering during ContentService refactoring.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds base class for ContentService performance benchmarks with:
- RecordBenchmark() for timing capture
- MeasureAndRecord() with warmup support for non-destructive ops
- MeasureAndRecord<T>() with warmup for read-only ops returning values
- JSON output wrapped in [BENCHMARK_JSON] markers for extraction
- skipWarmup parameter for destructive operations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Only validate segment values for cultures they are defined for.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Integration test suppressions.
* Remove previous implementation using ISegmentService and rely on values provided in the model to determine segments with cultures.
* Omit null culture and remove passing but unrealistic tests.
* Fixed nullability error.
* Apply suggestions from code review
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
* Relocated function following code review.
* Reset unchanged files.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
* Return not found when request for content references when entity does not exist.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Move check for entity existence from controller to the service.
* Update OpenApi.json.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Addressed points raised in code review.
* Update OpenApi.json
* Resolved breaking changes.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Applies checks for root folders to static file tree service.
* Add integration tests.
* Fix ancestor test.
* Amends from code review.
* Integration test compatibility suppressions.
* Reverted breaking change in test base class.
* Fix preview showing published version when Save and Preview is clicked multiple times
Fixes#20981
When clicking "Save and Preview" multiple times, the preview tab would show the published version instead of the latest saved version. This occurred because:
1. Each "Save and Preview" creates a new preview session with a new token
2. The preview window is reused (via named window target)
3. Without a URL change, the browser doesn't reload and misses the new session token
4. The stale page gets redirected to the published URL
Solution: Add a cache-busting parameter (?rnd=timestamp) to the preview URL, forcing the browser to reload and pick up the new preview session token. This aligns with how SignalR refreshes work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Improve Save and Preview to avoid full page reloads when preview is already open
When clicking "Save and Preview" multiple times with a preview tab already open, the entire preview tab would reload. This enhancement makes it behave like the "Save" button - only the iframe reloads, not the entire preview wrapper.
Changes:
- Store reference to preview window when opened
- Check if preview window is still open before creating new session
- If open, just focus it and let SignalR handle the iframe refresh
- If closed, create new preview session and open new window
This provides a smoother UX where subsequent saves don't cause the preview frame and controls to reload, only the content iframe refreshes via SignalR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Close preview window when ending preview session
Changes the "End Preview" behavior to close the preview tab instead of navigating to the published URL. This provides a cleaner UX and ensures subsequent "Save and Preview" actions will always create a fresh preview session.
Benefits:
- Eliminates edge case where preview window remains open but is no longer in preview mode
- Simpler behavior - preview session ends and window closes
- Users can use "Preview website" button if they want to view published page
Also removes unnecessary await on SignalR connection.stop() to prevent blocking if the connection cleanup hangs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix preview cookie expiration and add proper error handling
This commit addresses cookie management issues in the preview system:
1. **Cookie Expiration API Enhancement**
- Added `ExpireCookie` overload with security parameters (httpOnly, secure, sameSiteMode)
- Added `SetCookieValue` overload with optional expires parameter
- Marked old methods as obsolete for removal in Umbraco 19
- Ensures cookies are expired with matching security attributes
2. **PreviewService Cookie Handling**
- Changed to use new `ExpireCookie` method with explicit security attributes
- Maintains `Secure=true` and `SameSite=None` for cross-site scenarios
- Uses new `SetCookieValue` overload with explicit expires parameter
- Properly expires preview cookies when ending preview session
3. **Frontend Error Handling**
- Added try-catch around preview window reference checks
- Handles stale window references gracefully
- Prevents potential errors from accessing closed window properties
These changes ensure preview cookies are properly managed throughout their
lifecycle and support both same-site and cross-site scenarios (e.g., when
the backoffice is on a different domain/port during development).
Fixes#20981🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Track document ID for preview window to prevent reusing window across different documents
When navigating from one document to another in the backoffice, the preview window reference was being reused even though it was showing a different document. This meant clicking "Save and Preview" would just focus the existing window without updating it to show the new document.
Now we track which document the preview window is showing and only reuse the window if:
1. The window is still open
2. The window is showing the same document
This ensures each document gets its own preview session while still avoiding unnecessary full page reloads when repeatedly previewing the same document.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove updates to ICookieManager and use Cookies.Delete to remove cookie.
* Fix file not found on click to save and preview.
* Removed further currently unnecessary updates to the cookie manager interface and implementation.
* Fixed failing unit test.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Adding the sorter controller, and fixing some ui elements so you are able to drag the hostname elements around to sort them
* Fixed sorting
* Changed the html structure and tweaked around with the css to make it look better.
Added a description for the Culture section.
Alligned the rendered text to allign better with the name "Culture and Hostnames"
* Update src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.ts
Forgot to remove this after I was done testing
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.ts
Changing grid-gap to just gap
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Removed the disabled and readonly props I added since they are not needed.
Removed the conditional rendering that was attached to the readonly and disabled properties
* Removed the item id from the element and changed css and sorter logic to target the hostname-item class instead
* Updated test
* Bumped helpers
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: Andreas Zerbst <73799582+andr317c@users.noreply.github.com>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
* Added tests for notification emails for content
* Bumped version
* Updated tests for notification permission in content
* Added appsettings.json for smtp tests
* Added smtp test project
* Updated nightly E2E test pipeline yaml file to run smtp project in the pipeline
* Fixed command to run smtp4dev in Docker
* Fixed pipeline
* Only run smtp tests on Linux
* Debugged
* Debugging
* Added step to stop smtp4dev container
* Debugging
* Updated port
* Reverted tests
* Added more tests for notification emails
* Formatted code
* Update Swashbuckle to v10
* Regenerate backoffice api client
* Add missing space for consistency
* Simplify nullability check
* Small improvement
Didn't notice that these classes were internal, so tried keeping compatibility, but it wasn't needed.
* Fix failing integration test
* Apply suggestions from code review
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Remove unnecessary comma
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Updated block list tests as the “Add Block” button is hidden after reaching the maximum limit.
* Updated validation option due to UI changes
* Updated tests for current user profile as waitForNetworkToBeIdle() is removed
* Fixed flaky tests
* Bumped version
* Updated tests for current user profile
* Bumped version
* Preserve existing Examine FieldDefinitionCollection if it already exists (#20267)
* Fix missing bracket
* Minor tidy/addition of comments; addition of unit tests.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
(cherry picked from commit 908974c6ac)
* Preserve existing Examine FieldDefinitionCollection if it already exists (#20267)
* Fix missing bracket
* Minor tidy/addition of comments; addition of unit tests.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Add MemberType/MemberTypeContainer to supported EntityContainer object types
* Implement MemberTypeContainerRepository
* Update and add member type container API endpoints
* Complete server and client-side implementation for member type container support.
* Fix FE linting errors.
* Export folder constants.
* Applied suggestions from code review.
* Updated management API authorization tests for member types.
* Resolved breaking change on copy member type controller.
* Allow content types to be moved to own folder without error.
* Use flag providers for member type siblings endpoint.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Ensure redirects with domains are stored with the domain node id prefix.
* Handle removal of self-referencing redirect when domains are used.
* Use entity path to save further queries for retrieving ancestor IDs.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Applied refactoring suggested in code review.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Use empty folder under temp as localized text source folder in non umbraco core integration tests.
* Added clarifying comment to the GetLocalizedTextService override for tests
Handles rich text blocks created with TinyMCE in convert local links migration.
Refreshes internal datatype cache following migration requiring cache rebuild.
# Conflicts:
# src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs
Handles rich text blocks created with TinyMCE in convert local links migration.
Refreshes internal datatype cache following migration requiring cache rebuild.
Handles rich text blocks created with TinyMCE in convert local links migration.
Refreshes internal datatype cache following migration requiring cache rebuild.
* Removed skips for tests whose related issues have been fixed.
* Remove skip tags and update tests for content with list view
* Removed skip tags
* Added comment and change to fixme for tests that need to implement later
* Removed skip tag
* Bumped version