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

Created on 17 June 2016, almost 9 years ago
Updated 10 April 2024, about 1 year 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 24 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.

Production build 0.71.5 2024