- ๐บ๐ธUnited States dietric@gmail.com
dietric@gmail.com โ made their first commit to this issueโs fork.
- ๐ซ๐ทFrance urashima82
Hello, I'm sending a new patch because I was facing an issue when I tried to display comments. Due to a strange behavior of the comment_count property, the comments are not always shown.
I replace that by an entity query and it works.
To respond to @bigboy, I was facing the same redirect problem. To solve that, I used the hook_form to add my custom submit method.
Here is en example, feel free to improved it :/** * Implements hook_form_alter(). */ function my_module_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { $comment_forms = [ 'comment_comment_form', 'comment_comment_edit_form', 'comment_comment_delete_form', ]; if (in_array($form_id, $comment_forms)) { $form['actions']['submit']['#submit'][] = 'my_module_comment_fix_form_submit'; } } function my_module_comment_fix_form_submit(&$form, \Drupal\Core\Form\FormStateInterface $form_state) { $route_params = \Drupal::routeMatch()->getParameters(); if ($route_params->has('entity')) { $node = \Drupal::routeMatch()->getParameter('entity'); } else { // Get the comment entity. $comment = \Drupal::routeMatch()->getParameter('comment'); // Get the node entity. $node = $comment->getCommentedEntity(); } // Get translated url. $url = \Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' => $node->id()]); $form_state->setRedirectUrl($url); }
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - ๐ฎ๐ณIndia anchal_gupta
I have uploaded the patch.
Fixed CFF
Please review - Status changed to Needs review
about 1 month ago 9:57am 25 April 2025 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.)
- ๐ซ๐ทFrance erwangel
Thanks to cptX (#58), I have no more "page not found" errors. My site is multilingual but comments translation is not enabled. It was a disaster for SEO as every permalink was giving a "page not found" when not in the default interface language. I don't see a solution for this in the last patch (#62).