Skip to content

Deleted and hidden comments are exported #10613

@paulinebessoles

Description

@paulinebessoles

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

  1. Go to a proposal show page
  2. Report a comment and hide it in the moderation panel
  3. Write a comment, then delete it
  4. Export the comments for this proposal component
  5. 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:
Capture d’écran 2023-03-22 à 10 55 39

Both those comments are displayed in the exports, with no indication of their deletion or moderation:
Capture d’écran 2023-03-22 à 10 56 28

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions