Error: Call to a member function SetFont() on null

Created on 11 March 2024, 9 months ago

Problem/Motivation

I'm trying to use this module on Drupal 10.2.4.

I've applied all the patches currently in the queue, which removed all problems except the following. I can't use the module, views preview is not working and nothing happens when viewing the page that the PDF display is attached to. No icons show up, and when I visit the URL of the PDF display, I get a "Page not found" error.

In the log, this leaves two entries, an error and a warning:

Error: Call to a member function SetFont() on null in Drupal\views_pdf\Plugin\views\display\PDF->render() (line 227 of /var/www/***/modules/contrib/views_pdf/src/Plugin/views/display/PDF.php).


Warning: Undefined property: Drupal\views\ViewExecutable::$pdf in Drupal\views_pdf\Plugin\views\display\PDF->render() (line 227 of /var/www/***/modules/contrib/views_pdf/src/Plugin/views/display/PDF.php)

The status report shows both libraries are loaded:

Views PDF: fpdi library | Library fpdi supported, version: 2.6.0
Views PDF: tcpdf library | Library tcpdf supported, version: 6.6.5

Steps to reproduce

- Install the module on Drupal 10.2.4
- Create a view (I used one of commerce order entities)
- Add a page, add a PDF display
- Try to render a preview or try to visit the URL specified.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇹🇭Thailand AlfTheCat

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024