Skip to content

Conversation

@rohnsha0
Copy link
Member

@rohnsha0 rohnsha0 commented Sep 23, 2025

@rohnsha0 rohnsha0 requested a review from davisagli September 23, 2025 20:05
@mister-roboto
Copy link

@rohnsha0 thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!


<div class="d-flex flex-row align-items-center mb-3">
<div class="d-flex flex-row align-items-center mb-3"
tal:condition="python:not getattr(reply, 'is_deleted', False)"
Copy link
Member

Choose a reason for hiding this comment

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

I would add is_deleted to the tal:define above so we only look it up once, and then use it multiple times below.

I think you can just do tal:define="is_deleted reply/is_deleted" because you added a default value to the class at https://github.com/plone/plone.app.discussion/pull/285/files#diff-a5157979e70daaf24e0028ff6713df1ebc872221baca1bb812944b9cc566effcR118, so we don't have to use getattr with a default here.

Then the condition becomes tal:condition="not:is_deleted"

Copy link
Member Author

Choose a reason for hiding this comment

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

done in e9b745d

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be possible to search for text in a deleted comment and find it that way. So we probably need to return an empty string from the getText and Title methods below if is_deleted is true.

Copy link
Member Author

Choose a reason for hiding this comment

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

done in 0ad6e20

ps: some tests are failing coz of this change, will address later!

@rohnsha0
Copy link
Member Author

rohnsha0 commented Oct 1, 2025

@davisagli, imo we should expose the soft deletion behind a Discussion setting

my current implementation does not support... what's ur say!?

@davisagli
Copy link
Member

@rohnsha0 Do you mean that we should add a new boolean setting so the admin can decide whether to use hard or soft deletion of comments? That sounds ok to me.

@rohnsha0
Copy link
Member Author

rohnsha0 commented Oct 2, 2025

@rohnsha0 Do you mean that we should add a new boolean setting so the admin can decide whether to use hard or soft deletion of comments? That sounds ok to me.

Exactly

@rohnsha0 rohnsha0 linked an issue Oct 2, 2025 that may be closed by this pull request
@rohnsha0
Copy link
Member Author

rohnsha0 commented Oct 2, 2025

@jenkins-plone-org please run jobs

@rohnsha0 rohnsha0 requested a review from davisagli October 2, 2025 03:00
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.

Implement Soft Deletion

4 participants