Warning: Undefined array key "view_build" in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 139 of modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).

Created on 20 April 2023, over 1 year ago
Updated 6 August 2024, 4 months ago

Warning: Undefined array key "view_build" in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 139 of modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).

🐛 Bug report
Status

Needs review

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!4 for the issue mentioned, please review.
    Thank You.

  • 🇺🇸United States drupgirl

    Hi, the patch applies, but does not resolve the issue. These are the messages that result:

    Warning: Undefined array key "#view" in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 139 of modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).
    Drupal\views_pdf\Plugin\views\display\PDF::buildResponse...

    Warning: Attempt to read property "pdf" 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(...

  • 🇺🇸United States rclemings

    This looks like a caching issue. I was able to resolve it by setting "Caching" to "None" under "Advanced/Other" in the view configuration. The patch wasn't necessary.

    The OP's error was actually just the first of four (below). I noticed though that the problem went away if I rebuilt the Drupal cache. So disabling caching for the affected view was an easy fix, though there might be a better one.

    Warning: Undefined array key "view_build" in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 139 of /home/xxxxxx/public_html/web/modules/contrib/views_pdf/src/Plugin/views/display/PDF.php) 
    
    Warning: Trying to access array offset on value of type null in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 139 of /home/xxxxxx/public_html/web/modules/contrib/views_pdf/src/Plugin/views/display/PDF.php) 
    
    Warning: Attempt to read property "pdf" on null in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 141 of /home/xxxxxx/public_html/web/modules/contrib/views_pdf/src/Plugin/views/display/PDF.php) 
    
    Error: Call to a member function Output() on null in Drupal\views_pdf\Plugin\views\display\PDF::buildResponse() (line 141 of /home/xxxxxx/public_html/web/modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).
Production build 0.71.5 2024