Skip to content

fix(manager): block deleted tree move targets#2243

Open
middleDuckAi wants to merge 1 commit intoevolution-cms:3.5.xfrom
middleDuckAi:middleDuck/evo-2057-deleted-parent-drop
Open

fix(manager): block deleted tree move targets#2243
middleDuckAi wants to merge 1 commit intoevolution-cms:3.5.xfrom
middleDuckAi:middleDuck/evo-2057-deleted-parent-drop

Conversation

@middleDuckAi
Copy link
Collaborator

Problem

Dragging a published resource into a deleted tree node was still allowed by the manager UI. That made the tree attempt a move against a parent that should never accept children in the normal manager flow.

Why this approach

This keeps the fix bounded to the move flow itself:

  • block deleted tree targets in the manager before the DOM is reshuffled
  • keep a shared backend guard so deleted or missing parents stay rejected even if the UI is bypassed
  • cover both layers with focused regression tests

What changed

  • added tree-drop-guard-helper.js and loaded it in the manager frame
  • prevented drag enter / drag over / drop onto deleted tree nodes in both manager themes
  • exposed error_parent_deleted to the manager JS lang payload so the blocked drop shows the right message
  • extracted MoveDocumentTargetGuard and reused it in both AJAX move handlers and the Move Document controller

Files / surfaces

  • manager frame bootstrap
  • default manager tree drag/drop flow
  • liquid manager tree drag/drop flow
  • move document backend guard
  • focused JS + PHP regression tests

Verification

  • node --test manager/media/script/tests/tree-drop-guard-helper.test.js
  • ./vendor/bin/pest tests/Unit/MoveDocumentTargetGuardTest.php
  • ./vendor/bin/pest tests/Feature/ModifiersTest.php
  • php -l on touched PHP files
  • node --check on touched JS files
  • local runtime smoke check on the task branch

Risks

This is intentionally narrow and does not change unrelated tree ordering or move rules. It only blocks deleted parents and makes the server-side validation explicit.

Links

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.

3.1.8 Manager Tree moving document into deleted page (deleted page as folder) and its gone!

2 participants