digitalfabrik / integreat-cms

Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
https://digitalfabrik.github.io/integreat-cms/
Apache License 2.0
56 stars 35 forks source link

After deleting all sub-pages it's not possible to delete the parent page #3144

Open juliankehne opened 2 weeks ago

juliankehne commented 2 weeks ago

Describe the Bug

Its not directly possible to delete a page after deleting its sub-pages. The parent page first has to be updated or the page tree needs to be refreshed (e.g. by moving a page or creating a new page) before the page can be deleted.

Steps to Reproduce

  1. Go to 'Pages'
  2. Create a new page
  3. Create a second page as a sub-page for the first page
  4. Go back to 'Pages'
  5. Delete the sub-page
  6. Delete the parent page
  7. See that "Delete" icon is inactive (screenshot below)

Expected Behavior

"Delete" button should be clickable without having to update the page or page tree after deleting the sub-pages

Actual Behavior

After deleting the last sub-page of a page the "Delete" icon is greyed out and cannot be clicked. It only becomes available once page is updated or the page tree was refreshed, e.g. by moving a page or creating a new one.

Additional Information

Found in Version: 2024.10.12-alpha

cannot delete page without subpage

david-venhoff commented 2 weeks ago

Cannot reproduce this locally, but I can on the test server. Since I have redis disabled locally, it is probably a redis caching issue.

osmers commented 2 weeks ago

I mentioned during the call that I could reproduce it on the test system, even so far that I could not delete the page, even after refreshing - I found the problem with that @PeterNerlich: there were archived pages still attributed to this parent page so it appeared empty in the page tree but for system logic was not, bcs the archived pages are connected to it. I only saw that once I opened the page and tried to delete it there... so probably it is what David says :)

PeterNerlich commented 2 weeks ago

there were archived pages still attributed to this parent page so it appeared empty in the page tree but for system logic was not

That makes sense. The popup text does mention archived sub pages, but I think the communication here can be dramatically improved. We should at least make the popup more dynamic and tell exactly whether the page has archived sub pages or not.

This is a completely new idea I don't think we have anywhere else in the system, but what do you think about highlighting the Archived pages button when hovering over the disabled delete icon of a page that has archived children? And maybe even blinking it twice when the disabled delete icon is clicked?

osmers commented 2 weeks ago

We could think about that but definitely low prio as it is a problem that only affects us and not the municipalities. I think we have bigger issues to work on right now :)