Error: Call to a member function Output() on null in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 141 of modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).

Created on 20 April 2023, over 1 year ago
Updated 23 April 2024, 7 months ago

Error: Call to a member function Output() on null in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 141 of modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).
Drupal\views_pdf\Plugin\views\display\PDF::buildResponse('instruction', 'pdf_1', Array) (Line: 56)
Drupal\views\Routing\ViewPageController->handle('instruction', 'pdf_1', Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @dionhalcyon
  • First commit to issue fork.
  • @ranjit1032002 opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Ranjit1032002

    Created MR!3 for the issue mentioned, please review.
    Thank you.

  • Status changed to Postponed: needs info over 1 year ago
  • 🇸🇪Sweden killua99

    how can I replicate this error ?

  • Hello,
    I just have this error with an 10.0.8 Drupal and with a 9.5.9 Drupal
    My server have this configuration : Apache/2.4.54 (Unix) OpenSSL/1.1.1k PHP/8.1.6

    My views are basic, I left the default configuration, my path is in the form /convention-impression.
    The first time I generate the PDF view it works, but not after that.

    What do others want as pieces of information ?

  • 🇹🇼Taiwan cbroker

    I have the same issue and found that if I clear the cache, I can run it again.

  • 🇨🇦Canada leducdubleuet Chicoutimi QC

    I had the same issue, the views_pdf was exporting to PDF only the first time and clearing the cache made it work again but only once.

    I tried the patch in MR!3 but it was creating an error on the return $response...

    So I disabled the cache on the PDF view and now it is working well everytime!

    I had the "Tag based" and using "No caching" made it work.

  • 🇪🇸Spain abelass

    Same for me emptying the cache or removing caching from the view removes the error

  • Status changed to Needs work 7 months ago
  • 🇨🇦Canada leducdubleuet Chicoutimi QC

    So to replicate this error, you leave the cache on and the view pdf will work only once the first time.

    Disabling the cache completely on the view solves this issue for good.

    Thank you for looking into this.

Production build 0.71.5 2024