plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
427 stars 575 forks source link

I can delete the parent page deeper down the tree in contents view #5931

Open Nimo-19 opened 1 month ago

Nimo-19 commented 1 month ago

Describe the bug

If I select a page in the contents view, then in the content view somewhere else in the tree and click delete, I delete the previously selected page, even though the dialog shows no items.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'demo.plone.org' and Login
  2. Create a Page 'test-page-1' and 'test-page-2' in the root folder
  3. Go to the contents view of the root folder
  4. Select the checkbox of 'test-page-1'
  5. Enter the 'test-page-2' in the contents view
  6. Click the delete button of the contents view
  7. Click Delete on an empty Confirm dialog
  8. try viewing the test-page-1

Then the test-page-1 has been deleted

Expected behavior

The page 'test-page-1' is not selected/deleted when I change the contents view or the page 'test-page-1' is shown in the confirm dialog.

Software (please complete the following information):

stevepiercy commented 1 month ago

Why is this a bug? When you delete a page as you did in Step 6, it goes away, and it is not possible to do Step 8. I cannot reproduce this issue as described. Please edit your report so that anyone can reproduce it.

Nimo-19 commented 1 month ago

Edited the steps, hope it is more clear now

stevepiercy commented 1 month ago

Ah, now I see. Confirmed. What would you suggest to prevent deletion of a checked Item1 when viewing Item2, then clicking Delete? I think once you leave the item list view, then any selection should be purged.

Nimo-19 commented 1 month ago

I think once you leave the item list view, then any selection should be purged.

Yeah, think so too. It seems strange to me that something is still checked if I navigate away from it. Although it seems to easy to accidentally check the box when navigation carelessly and than delete something you don't want to delete.