Warning if no doc is uploaded

Created on 12 July 2024, 3 months ago

Steps to reproduce

When creating a new View the following warning pops up:

Warning: Undefined array key "doc_serialization" in Drupal\doc_serialization\Plugin\views\display_extender\DocSerialization->optionsSummary() (line 52 of modules/contrib/doc_serialization/src/Plugin/views/display_extender/DocSerialization.php).

Stacktrace:

Drupal\doc_serialization\Plugin\views\display_extender\DocSerialization->optionsSummary(Array, Array) (Line: 1377)
Drupal\views\Plugin\views\display\DisplayPluginBase->optionsSummary(Array, Array) (Line: 408)
Drupal\views\Plugin\views\display\PathPluginBase->optionsSummary(Array, Array) (Line: 279)
Drupal\rest\Plugin\views\display\RestExport->optionsSummary(Array, Array) (Line: 111)
Drupal\doc_serialization\Plugin\views\display\WordExport->optionsSummary(Array, Array) (Line: 595)
Drupal\views_ui\ViewEditForm->getDisplayDetails(Object, Array) (Line: 395)
Drupal\views_ui\ViewEditForm->getDisplayTab(Object) (Line: 212)
Drupal\views_ui\ViewEditForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object) (Line: 42)
Drupal\views_ui\ViewFormBase->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('view_edit_form', Object) (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'edit', Array) (Line: 220)
Drupal\views_ui\Controller\ViewsUIController->edit(Object, 'word_export_1')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
🐛 Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

🇦🇹Austria daniel.pernold

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @daniel.pernold
  • Assigned to abhiyanshu_rawat
  • Merge request !14Resolve the fatal error → (Open) created by abhiyanshu_rawat
  • 🇮🇳India abhiyanshu_rawat

    I followed the same steps to reproduce the issue, but instead, I encountered another error that appears as soon as we enable this module.

    Fatal error: Declaration of Drupal\doc_serialization\Encoder\Doc::encode($data, $format, array $context = []) must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode(mixed $data, string $format, array $context = []): string in /var/www/html/modules/contrib/doc_serialization/src/Encoder/Doc.php on line 44

    The above error is encountering due to a mismatch between the method signature in your class and the method signature defined in the EncoderInterface from Symfony. I have updated encode method to match the interface's signature.

    I tried to reproduce the issue again, and the view is now creating successfully without any warnings. Kindly review. Thanks.

  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • 🇮🇳India abhiyanshu_rawat

    Now able to create a view successfully without any warnings.

Production build 0.71.5 2024