Problem/Motivation

The 'Reply' button adds a new comment form after every click. This is confusing for users, since they expect a single comment form.

Proposed resolution

Users who click the 'Reply' button multiple times only see a single comment form.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

Users who click the 'Reply' button multiple times only see a single comment form.

API changes

None.

Data model changes

None.

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
StatusFileSize
new1.22 KB

Attached patch removes any earlier Ajax Comment reply forms when applicable, so users who click the 'Reply' button multiple times only see a single comment form.

wturrell’s picture

This doesn't seem to work 100% of the time for me (I'm using hook_ENTITY_TYPE_view_alter to hide comments by other users, I'm unclear if that could break the JS selector) - it's definitely an improvement and I'm using the patch, but there's still something not quite right…

hoporr’s picture

Reviewerd: Patch solves problem for me.

falco010’s picture

Status: Needs review » Reviewed & tested by the community

Patch provided #2 solved this issue for me, functionally tested this and is working as expected.

Thanks @idebr for the patch.

@wturrel Why are you hiding comments with hook_ENTITY_TYPE_view_alter? And not using the core "Comment settings" to display the comments as Open/Closed/Hidden?

wturrell’s picture

@Falco010 it's a project where the client doesn't want people in a certain role to be able to see each other's comments, but admin roles can see all of them as normal.

As I recall (it was 8 months ago), I thought the patch had worked at first, but then I started to notice other weird behaviour, so I decided to stop using the module.

  • qzmenko committed 4b0c423 on 8.x-1.x authored by idebr
    Issue #2987132 by idebr: Reply button can be pressed multiple times,...
qzmenko’s picture

Commited and pushed, thanks!

qzmenko’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.