Submitting a comment in the non default language redirects you to the default language

Created on 17 June 2016, over 8 years ago
Updated 10 April 2024, 8 months ago

Problem/Motivation

In a multilingual site if you add a comment on a node which is in the default language, everything is okay.
But if you add a comment on a node which is not in the default language, I get redirected to the default language translation of the node.

This is very confusing for the end user and they should stay in the same node language after submitting a comment.

Steps to reproduce the issue

This is very easy to replicate on simplytest.me (choose multilingual setup).

If simplytest.me is down (as it currently appears to be), use the following:

  1. $ composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
  2. install Drupal (for example, use drush si to install Drupal in Italian):
    $ drush si standard \
      --db-url='mysql://root@127.0.0.1/some_dir' \
      --account-name="Kay V" --account-pass=silly.walk.ministry \
      --site-name=Some-Dir \
      --site-mail=noreply@example.com \
      --locale=it
  3. add other languages (e.g. Chinese (simplified), French & English) via UI at admin/config/regional/language
  4. otherwise leave defaults (e.g. skip enabling language switching block; leave Detection and selection method as Url; leave language prefixes unchanged)
  5. add an article in the default language (by default the article content type includes all entity requirements involved in this bug report) /node/add/article
  6. add a comment to the article and hit save
  7. note whether a language prefix appears in the url (no prefix should be there, as this is the default language)
  8. create a new article in another language by entering a different prefix in the url e.g. /en/node/add/article
  9. add a comment to the article and hit save
  10. note again whether a language prefix appears in the url (if the issue exists, the prefix will be missing)
  11. apply patch
  12. drop db tables
  13. repeat from step 2 above

Proposed resolution

Redirect the user to the node translation where the comment is made.

Remaining tasks

#67 πŸ› Submitting a comment in the non default language redirects you to the default language Needs work .4
#79 πŸ› Submitting a comment in the non default language redirects you to the default language Needs work .4
#81 πŸ› Submitting a comment in the non default language redirects you to the default language Needs work

Manual testing

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
CommentΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡§πŸ‡ͺBelgium yvesvanlaer

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    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.

    Did not read all the comments yet.

    But see there are few items in the remaining tasks to be addressed.
    Also was tagged for a follow up was that done?

    Can re-review later once those are updated

    Thanks.

  • Status changed to Needs review 8 months ago
  • πŸ‡¨πŸ‡¦Canada wuinfo - bill wu

    The patch fixes the issue of the page returning to the default language page after submitting a comment in the non-default language comment form. It did not resolve other problems related to previewing comments and deleting comments. The patch is for Drupal development branch 10.2.x.

  • Status changed to Needs work 8 months ago
  • The Needs Review Queue Bot β†’ tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request β†’ . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • Pipeline finished with Failed
    8 months ago
    Total: 174s
    #142967
  • Status changed to Needs review 8 months ago
  • Status changed to Needs work 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thanks for picking up

    MR should be pointed at 11.x branch

    Appears to have some remaining tasks that need to be addressed or answered.

  • Pipeline finished with Running
    8 months ago
    #143239
Production build 0.71.5 2024