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:
$ composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
- 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
- add other languages (e.g. Chinese (simplified), French & English) via UI at
admin/config/regional/language
- otherwise leave defaults (e.g. skip enabling language switching block; leave Detection and selection method as Url; leave language prefixes unchanged)
- 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
- add a comment to the article and hit save
- note whether a language prefix appears in the url (no prefix should be there, as this is the default language)
- create a new article in another language by entering a different prefix in the url e.g.
/en/node/add/article
- add a comment to the article and hit save
- note again whether a language prefix appears in the url (if the issue exists, the prefix will be missing)
- apply patch
- drop db tables
- repeat from step 2 above
Proposed resolution
Redirect the user to the node translation where the comment is made.
Remaining tasks
Manual testing
User interface changes
None.
API changes
None.
Data model changes
None.