Skip to content

Conversation

@rohnsha0
Copy link
Member

@rohnsha0 rohnsha0 commented Sep 21, 2025

ref #2966

to be merged together:-

  • plone.base - #81
  • plone.app.discussion - #284
  • plone.app.content - #312
  • plone.app.vocabulary - #109
RecycleBinView RecycleBinItemView

replaces #4168

rohnsha0 and others added 30 commits September 20, 2025 21:52
@rohnsha0
Copy link
Member Author

I've reviewed the browser views now. I still need to review the recycle bin utility and the tests.

I have added fixes for the suggested changes! You may continue reviewing!

return False

try:
# Purge any nested children first if this is a folder
Copy link
Member

Choose a reason for hiding this comment

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

Is this the same thing that _cleanup_child_references does?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is more or less the same thing, this is used when deleting an item permanently... I could've refactored it into a single func...

Copy link
Member

Choose a reason for hiding this comment

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

And similarly, I don't think we need or want to do this.

…y for better localization support and optimize addition of workflow entries
…isting_object method by removing _v_restoring_from_recyclebin check
@rohnsha0 rohnsha0 requested a review from davisagli September 29, 2025 04:39
@rohnsha0
Copy link
Member Author

@davisagli, I have made the next set of changes with some clarifications reqd from u... check #4223 (comment)

child_path = child_data.get("path")
child_orig_id = child_data.get("id")

for storage_id, storage_data in list(self.storage.get_items()):
Copy link
Member

Choose a reason for hiding this comment

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

@rohnsha0 Okay, I took another look. Actually I misunderstood. The children are only stored under their parent in ["children"], and not separately stored at the top level of the recycle bin. I think that is good.

I also think it means we don't need to do this process to clean up items with the same path as a child. If I delete an item /a that has a child /a/b, and then I create a new item /a/b and delete it, it should exist as a separate entry in the recycle bin. Restoring or purging the first item that was deleted should not affect the second one. It should remain in the recycle bin, and could be restored to a different path.

return False

try:
# Purge any nested children first if this is a folder
Copy link
Member

Choose a reason for hiding this comment

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

And similarly, I don't think we need or want to do this.

# Get items sorted by date (oldest first) and calculate total size
for item_id, data in self.storage.get_items_sorted_by_date(reverse=False):
size = data.get("size", 0)
total_size += size
Copy link
Member

Choose a reason for hiding this comment

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

We should also include the size of any children, right?

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.

4 participants