Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments block: The setting for "Enable threaded (nested) comments" is ignored #44257

Closed
andersnoren opened this issue Sep 19, 2022 · 6 comments · Fixed by #44351
Closed

Comments block: The setting for "Enable threaded (nested) comments" is ignored #44257

andersnoren opened this issue Sep 19, 2022 · 6 comments · Fixed by #44351
Assignees
Labels
[Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Type] Bug An existing feature does not function as intended

Comments

@andersnoren
Copy link

Description

If you uncheck the "Enable threaded (nested) comments" in Settings → Discussion, block themes still display threaded/nested comments. This is different from classic themes, in which threaded comments are displayed without nested lists when the setting is unchecked.

Step-by-step reproduction instructions

  1. Create a post with threaded comments.
  2. Disable the "Enable threaded (nested) comments" setting in Settings → Discussion.
  3. Activate a block theme.
  4. Visit the post. The list is still output with threaded comments.
  5. Switch to classic theme.
  6. Visit the post again, and the list is now flat, without nested list elements.

Screenshots, screen recording, code snippet

Running Twenty Twenty-Three:
image

Running Twenty Nineteen:
image

Environment info

WP 6.0.2
Gutenberg 14.1.0
Twenty Twenty-Three and Twenty Nineteen

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@artemiomorales
Copy link
Contributor

I was able to replicate this with WP 6.0.2 and Gutenberg 14.1.0 using the Twenty Twenty-Three theme.

However, I was unable to replicate it in Twenty Twenty-Two, where the comments appear as expected:

Screen Shot 2022-09-19 at 5 27 03 PM

Perhaps this issue should be opened in the Twenty Twenty-Three repo?

@artemiomorales artemiomorales added [Type] Bug An existing feature does not function as intended [Status] Needs More Info Follow-up required in order to be actionable. labels Sep 19, 2022
@andersnoren
Copy link
Author

andersnoren commented Sep 20, 2022

Twenty Twenty-Three uses the new <!-- wp:comments --> block, while Twenty Twenty-Two uses the deprecated <!-- wp:post-comments /--> block.

It's possible that this was working in the old version of the comments block, but is not working in the new one.

Edit: I tried inserting both the deprecated <!-- wp:post-comments /--> and the new Comments block in one of my own themes, and the first adheres to the "Enable threaded (nested) comments" while the latter doesn't. Old to the left, new to the right.

image

@artemiomorales artemiomorales added [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Sep 20, 2022
@annezazu
Copy link
Contributor

Thanks so much for reporting and replicating. @Poliuk as a heads up.

@carolinan
Copy link
Contributor

carolinan commented Sep 21, 2022

When I disable the nested comments option, I also see a repetition, the comments are both on the first level, and nested.
Front:
image

@carolinan
Copy link
Contributor

carolinan commented Sep 21, 2022

In the editor, when I disable the nested comments, I only see 1 comment, the replies that were created as replies to the first comment, does not show as top level comments.
Even though only one comment shows, the comment reply title says there are 3 comments.

@SantosGuillamot
Copy link
Contributor

Thanks a lot for filing the issue and testing it 🙂

I have just created this Pull Request with a potential solution to fix it. I am not 100% familiar with the code so I am not sure it is the best approach. I've asked @c4rl0sbr4v0 and @DAreRodz to take a look at it because they were more involved in the Comments blocks code.

@glendaviesnz glendaviesnz moved this from Triage to In Progress in WordPress 6.1 Editor Tasks Sep 23, 2022
Repository owner moved this from In Progress to Done in WordPress 6.1 Editor Tasks Sep 26, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comments Affects the Comments Block - formerly known as Comments Query Loop [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants