Automattic / Automattic/jetpack

Comments: form uses wrong comment ID when user is logged in locally, logged out from wpcom

Open
#3,371 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Comments [Pri] Low Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Steps to reproduce:
1. Under Settings > Discussion, check that box:
> Users must be registered and logged in to comment
2. Log out of your site.
3. Log back in during a different account.
4. Log out of WordPress.com.
5. Open a post, and leave a comment.
6. The comment will be left under another post, using post ID `14`. That post ID is the same on 2 different blogs where I followed the steps above.

Here is how the comment form looks like in the inspector:
- When logged in to WordPress.com (looking good):

![good](https://cloud.githubusercontent.com/assets/426388/12800283/34d1071c-cad4-11e5-8cdb-584d28b64a0e.jpg)
- When logged out:

![14](https://cloud.githubusercontent.com/assets/426388/12800279/2effdebc-cad4-11e5-9f44-fb4e758bfc08.jpg)

Reported here:
https://wordpress.org/support/topic/comments-appear-under-wrong-post-jetpack2016

Contributor guide

Open the contributing guide

Research direction

Reproduce the listed login and logout sequence, then inspect the comment form on the affected post and compare its post ID with the logged-in WordPress.com case. Trace where the form obtains that ID; done means the comment is submitted under the post being viewed rather than post ID 14.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.