Skip to content

Conversation

@lauraneto
Copy link
Contributor

Summary

  • Add DisableDeleteWhenReferenced support for elements when emptying recycle bin
  • Fix pagination in EmptyRecycleBin when some items are skipped due to being referenced
  • Add SqlLessThan/SqlGreaterThan SQL expression extensions for string comparison in LINQ queries
  • Verify DisableUnpublishWhenReferenced works for elements (inherited from base class)

Changes

EmptyRecycleBin pagination fix

When DisableDeleteWhenReferenced is enabled and some items are skipped, the standard skip/take pagination breaks. This change:

  • Uses path-based cursor pagination instead of skip/take
  • Tracks protected paths to prevent deleting containers that have referenced descendants
  • Adds ElementRecycleBin to UmbracoObjectTypes enum

SQL expression extensions

  • Adds SqlLessThan and SqlGreaterThan extension methods for string comparison in LINQ queries
  • These translate to SQL < and > operators

Tests

  • Add test for DisableDeleteWhenReferenced with pagination across multiple pages
  • Add tests for DisableUnpublishWhenReferenced for elements

@lauraneto lauraneto force-pushed the v18/feature/element-reference-tracking branch from 1285e01 to 5d35055 Compare February 3, 2026 12:46
…fications

- Add DisableDeleteWhenReferenced check to ElementContainerService delete operations
- Fire ElementDeletedNotification and EntityContainerDeletedNotification per item during descendant deletion
- Fix potential infinite loop when items are skipped due to being referenced
- Simplify EmptyRecycleBinAsync to use DeleteDescendantsLocked directly
- Use path descending ordering for consistent deletion order (children before parents)
- Add test for descendant delete notifications
…nced

When DisableDeleteWhenReferenced is enabled and some items are skipped,
the standard skip/take pagination breaks. This change:

- Adds SqlLessThan/SqlGreaterThan SQL expression extensions for string
  comparison in LINQ queries
- Uses path-based cursor pagination instead of skip/take
- Tracks protected paths to prevent deleting containers that have
  referenced descendants
- Adds ElementRecycleBin to UmbracoObjectTypes enum
Verify that DisableUnpublishWhenReferenced works correctly for elements
(inherited from ContentPublishingServiceBase):
- Cannot unpublish an element that is being referenced
- Can unpublish an element that is doing the referencing
The Trashed filter was redundant because:
- EmptyRecycleBinAsync only operates on items under the recycle bin root
- DeleteFromRecycleBinAsync requires containers to be trashed, and all
  descendants are marked as trashed when moved to recycle bin

Removing the filter simplifies the query and handles edge cases better.
@lauraneto lauraneto force-pushed the v18/feature/element-reference-settings branch from 03b23fd to c85ffbc Compare February 3, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants