Describe the bug
As an admin, when exporting comments from a component (i.e proposal component), the export file contains:
The export doesn't display any column that shows that those comments are hidden or deleted on the platform. This is a problem, because the admins have then to go manually to the platform to know the comments that have been deleted or hidden, and then remove them manually from the export file for further analysis.
To Reproduce
- Go to a proposal show page
- Report a comment and hide it in the moderation panel
- Write a comment, then delete it
- Export the comments for this proposal component
- See that both comments will be displayed
Expected behavior
As an admin, I'd like the comments exports to contain only the comments that are visible on the platform, so to exclude hidden and deleted comments.
Screenshots
The proposal have a hidden and a deleted comment:

Both those comments are displayed in the exports, with no indication of their deletion or moderation:

Stacktrace
No response
Extra data
- Device: All
- Device OS: All
- Browser: All
- Decidim Version: 0.28.0.dev, 0.27, 0.26
- Decidim installation: nightly, try, client installation
Additional context
For further details, see this comment by Antti:
I also believe currently comment exports will contain the moderated comments based on this:
|
Comment |
|
.where(decidim_root_commentable_id: resource_class.where(component: component)) |
|
.where(decidim_root_commentable_type: resource_class.to_s) |
E.g. at proposals:
|
Decidim::Comments::Export.comments_for_resource( |
|
Decidim::Proposals::Proposal, component_instance |
|
).includes(:author, :user_group, root_commentable: { component: { participatory_space: :organization } }) |
Originally posted by @ahukkanen in #6398 (comment)
Describe the bug
As an admin, when exporting comments from a component (i.e proposal component), the export file contains:
The export doesn't display any column that shows that those comments are hidden or deleted on the platform. This is a problem, because the admins have then to go manually to the platform to know the comments that have been deleted or hidden, and then remove them manually from the export file for further analysis.
To Reproduce
Expected behavior
As an admin, I'd like the comments exports to contain only the comments that are visible on the platform, so to exclude hidden and deleted comments.
Screenshots
The proposal have a hidden and a deleted comment:

Both those comments are displayed in the exports, with no indication of their deletion or moderation:

Stacktrace
No response
Extra data
Additional context
For further details, see this comment by Antti:
Originally posted by @ahukkanen in #6398 (comment)