Unable to preview the comment

Steps to reproduce

  1. Log in to the application as a [User Role, e.g., Admin or Guest].
  2. Navigate to a specific piece of content where comments are enabled.
  3. Locate the comment section and click the "Add New Comment" button.
  4. Enter text into the "Subject" field .
  5. Enter text into the "Comment" text area (e.g., "This is a professional test comment.").
  6. Click the "Preview" button.

Below is the issue log information
The website encountered an unexpected error. Try again later.

LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connection->__sleep() (line 1920 of core/lib/Drupal/Core/Database/Connection.php).
serialize() (Line: 14)
Drupal\Component\Serialization\PhpSerialize::encode() (Line: 129)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->doSetWithExpire() (Line: 145)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire() (Line: 193)
Drupal\Core\Form\FormCache->setCache() (Line: 463)
Drupal\Core\Form\FormBuilder->setCache() (Line: 441)
Drupal\Core\Form\FormBuilder->rebuildForm() (Line: 633)
Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm() (Line: 251)
Drupal\comment\Controller\CommentController->getReplyForm()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Comments

quietone’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

I tested this with Drupal 10.4.10 using https://simplytest.me/ and was not able to reproduce the problem.

Is there custom or contributed code on the site that may be causing this?

quietone’s picture

Version: 10.4.x-dev » 11.x-dev

Still, in Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Thanks.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

mohit_aghera’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I came across this issue while doing bugsmash triage.

Closing this for now since we can't reproduce the issue anymore.
Please reopen again if you notice issue still exists.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.