Problem/Motivation

Steps to reproduce:

  1. Install Drupal
  2. Install (Enable) comment, language and content translation modules
  3. Add a language and configure Article as translatable, including the comment field
  4. Create an article and add a translation
  5. Comment on the article or the translation
  6. View the translation as anonymous, confirm you cannot see any comments (view it in the default language and confirm you can see comments)
  7. Disable translation of the comment field
  8. Confirm you can now see comments on the translated node

With translation disabled for comments field:

With translation enabled for comments field:

Proposed resolution

Comments appear on the translated node

Remaining tasks

  1. Agree on how this should work
  2. Write a patch with tests
  3. Review

User interface changes

None

API changes

None

Data model changes

None

Issue fork drupal-2958935

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cgomezg created an issue. See original summary.

adriancid’s picture

Issue summary: View changes
adriancid’s picture

Title: Comments created in translation are displayed only in original node » Comments created in translation are displayed only in the default language
cgomezg’s picture

Issue summary: View changes
adriancid’s picture

Issue summary: View changes

I made a test and the is saved on the correct language, so, it seems that is on the load of the comment where the language is not filtered.

cgomezg’s picture

Issue summary: View changes
adriancid’s picture

I think that this is a duplicate of: #2751267: Comments are not filtered on language. It seems to me that our problem here is related with the page cache, try to clean the cache to check if you see the comments.

cgomezg’s picture

Title: Comments created in translation are displayed only in the default language » Comments created in translation are displayed only for admin role
Issue summary: View changes
adriancid’s picture

Status: Active » Needs review
StatusFileSize
new1.15 KB
adriancid’s picture

StatusFileSize
new1.04 KB

Status: Needs review » Needs work
adriancid’s picture

Status: Needs work » Needs review

Sorry, the working patch is in #9

cgomezg’s picture

This patch solved my issue temporary

andypost’s picture

Status: Needs review » Needs work

Patch removes security check which is a must, probably issue in permissions of the user

andrew-as’s picture

Category: Bug report » Support request
Status: Needs work » Active

Totally agree with @andypost.
Please go to /admin/people/permissions and check all parameters in "relation" Comment - ANONYMOUS USER.
Please pay attention to checkbox "Post comments".
If you decided :) that anonym can left their comments you will enable "Post comments" checkbox. Also if you want skip of administer moderation you can enable "Skip comment approval". I suppose we don't have bug in this case.
If steps what was described above are did but issue is staying we have to continue investigation.

adriancid’s picture

Category: Support request » Bug report
Issue summary: View changes

The user have the permissions.

adriancid’s picture

Status: Active » Needs work
adriancid’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB
alonaoneill’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
neslee canil pinto’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB
alonaoneill’s picture

Patch applied on 8.8x!

yogeshmpawar’s picture

Issue tags: -Needs reroll
cgomezg’s picture

Assigned: Unassigned » cgomezg
neslee canil pinto’s picture

Changing it to 8.8.x

neslee canil pinto’s picture

Version: 8.5.0 » 8.8.x-dev
matsbla’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.
The patch fix the issue!

matsbla’s picture

Version: 8.8.x-dev » 8.9.x-dev
andypost’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -comments +Needs tests

As a bug it should have tests to make sure it fixed

pameeela credited ale_wwb.

pameeela’s picture

I can confirm this issue occurs, I was able to reproduce it when triaging #2712901: Unauthorized users cannot see comments of translated nodes, which I have closed as a duplicate. It is not a permissions issue either because the comments appear for anonymous on the default node, and I noticed that if you disable translation for the comment field, the comments will show on the translated node as well.

I don't know how this is supposed to work, but certainly, the issue reported is valid. I have updated the steps to reproduce based on the other issue, to make them a bit simpler.

raman.b’s picture

Version: 8.9.x-dev » 9.2.x-dev
Assigned: cgomezg » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.98 KB
new4.14 KB

Adding a quick test to demonstrate the bug and fix from #20

The last submitted patch, 31: 2958935-31-test-only.patch, failed testing. View results

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

doxigo’s picture

I can confirm this as well, the patch provided works as expected

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bigboy’s picture

Had some problems with this issue as well. Don't want to duplicate my comment, so I'll just leave a link here - https://www.drupal.org/project/drupal/issues/2751267#comment-14810709

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned
StatusFileSize
new43.36 KB
new22.78 KB

Successfully Applied patch #31 for Drupal 10.1.x version. It is working as expected. Adding screenshots to refer after and before patch.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

Following the steps of the issue summary. I commented on the english article and as admin could see the comment on the spanish page. But when anonymous I cannot see the comments. Even though the permissions are right and comment field is translatable.

Applying the patch did not change anything.

This will need an issue summary update as the proposed solution is a question. What was decided?

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

idebr made their first commit to this issue’s fork.

idebr’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

#2751269: Submitting a comment in the non default language redirects you to the default language is now postponed on this issue.

Updated the issue summary from a question to a statement

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

kuldeepbarot’s picture

StatusFileSize
new4.14 KB

Updated patch from #31 to make it compatible with D11.4.5