Unable to preview the comment
Steps to reproduce
- Log in to the application as a [User Role, e.g., Admin or Guest].
- Navigate to a specific piece of content where comments are enabled.
- Locate the comment section and click the "Add New Comment" button.
- Enter text into the "Subject" field .
- Enter text into the "Comment" text area (e.g., "This is a professional test comment.").
- 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
Comment #2
quietone commentedI 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?
Comment #3
quietone commentedStill, 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.
Comment #5
mohit_aghera commentedI 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.