Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298122

On the translated node the comment preview functionality is not working

$
0
0

Problem/Motivation

In a multilingual site, if you are adding a comment on a node that is in the default language, the preview functionality works as expected.
Whereas, on the translated node the comment preview functionality results in an error as it tries to render the comment field in an infinite loop.

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):
  3.   $ 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 \
  4. add other languages (e.g., Marathi and French) via UI at admin/config/regional/language
  5. otherwise leave defaults (e.g., skip enabling language switching block; leave Detection and selection method as Url; leave language prefixes unchanged)
  6. 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
  7. after that add translation to the content
  8. Navigate to the article with the default language. e.g. url /node/
  9. add a comment to the article and hit preview
  10. it will show the comment preview + form + content
  11. save the comment.
  12. now navigate to the translated article page, for french the url will be /fr/node/
  13. add a comment to the article and hit preview
  14. it will lead to WSOD, or some error log

Proposed resolution

Set the status of the comment field on the entity to hidden after the preview is built.

Remaining tasks

Patch.

User interface changes

None.

API changes

Not sure.

Data model changes

None.

Original report by rahul.shinde

In a multilingual site, if you are adding a comment on a node that is in the default language, the preview functionality works as expected.
Whereas, on the translated node the comment preview functionality throws the following message when Xdebug is on,
"The website encountered an unexpected error. Please try again later." with watchdog entry

Error: Maximum function nesting level of '512' reached, aborting! in Drupal::service() (line 157 of /app/core/lib/Drupal.php) 
......

otherwise, find the following error in the PHP error log,
"PHP Fatal error: Maximum execution time of 30 seconds exceeded in ../vendor/symfony/http-foundation/Request.php on line 2108"


Viewing all articles
Browse latest Browse all 298122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>