Skip to content

Fix bulk deletion of nested pages (#4506) - #4715

Merged
MizukiTemma merged 4 commits into
digitalfabrik:developfrom
ahmedchaar:fix/4506-nested-page-deletion
Nov 26, 2026
Merged

MizukiTemma merged 4 commits into
digitalfabrik:developfrom
ahmedchaar:fix/4506-nested-page-deletion

Conversation

@malakbenjemaa

@malakbenjemaa malakbenjemaa commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Short description

Fix bulk deletion of nested pages by processing children before their parents.

Proposed changes

  • Process selected pages in descending order of tree depth.
  • Keep the existing deletion checks and permissions unchanged.
  • Add a regression test for deleting a three-level page hierarchy.

Side effects

The change only affects the processing order of page bulk deletion. Other bulk actions are not intended to be affected.

Faithfulness to issue description and design

There are no intended deviations from the issue description.

How to test

  • Added test_bulk_delete_nested_pages to cover the reported bug.
  • Backend tests were run successfully using FakeWebpackLoader to avoid a local Webpack build issue.
  • With the standard local configuration, eight existing tests are blocked by an incomplete Webpack build (WebpackLoaderBadStatsError).
  • Manual verification in the CMS interface is still pending.
  • All 9 backend tests passed using FakeWebpackLoader. To reproduce the results locally, temporarily set WEBPACK_LOADER["DEFAULT"]["LOADER_CLASS"] to "webpack_loader.loaders.FakeWebpackLoader" in test_settings.py, as the local Webpack build is incomplete and causes WebpackLoaderBadStatsError during page rendering. This temporary configuration is not included in the PR.

To verify manually:

  1. Create a parent page with a child and a grandchild.
  2. Select all three pages and use the bulk deletion action.
  3. Check that all three pages are removed.
  4. Check that deleting a parent without selecting its child is still rejected.

Resolved issues

Fixes: #4506

@malakbenjemaa
malakbenjemaa marked this pull request as ready for review November 24, 2026 21:46
@MizukiTemma MizukiTemma added this to the Roadmap T45K milestone Nov 25, 2026
@MizukiTemma
MizukiTemma self-requested a review November 25, 2026 09:38

@MizukiTemma MizukiTemma left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your first contribution in our repository 🎉 It looks good 😸

I added two changes:

  1. Showing a hint to users that there can be archived subpages that blocked deletion if bulk deletion fails
Screenshot 2026-11-25 184910

You can reproduce such a case by bulk-deleting those 4 pages in the default data set:
Screenshot 2026-11-25 184808-1

  1. Added a release note

If you find those changes good, please squash the commits and merge the PR 👍

@malakbenjemaa

Copy link
Copy Markdown
Contributor Author

Thank you for reviewing my PR and for the additional improvements! Both changes look good to me.

I don't seem to have permission to merge the PR into the main repository. Could you please squash and merge it on your side?

Thanks again for your help!

@MizukiTemma
MizukiTemma merged commit 817e23c into digitalfabrik:develop Nov 26, 2026
5 checks passed
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.

Not possible to delete a root page together with its nested pages

2 participants