Deprecations in FPDI reported when using PHP 8.2

Created on 17 October 2024, about 1 month ago

Problem/Motivation

With PHP 8.2, loading a PDF page created as described below results in numerous deprectations of the form:

Deprecated function: Callables of the form ["PdfTemplate", "TCPDF::SetFont"] are deprecated in FPDF_TPL->SetFont() (line 303 of /var/www/html/d7-dev.localhost/sites/all/libraries/fpdi/fpdf_tpl.php).

Inspection of the fpdf_tpl.php code reveals that the same deprecated construct is used also in lines 156, 333, 360, 382, 404 and 426.

Steps to reproduce

Create a view, which generates a PDF page on-the-fly with Format "PDF Unformatted"
Load the page

Proposed resolution

Given the impending end of support for Drupal 7 it would be unreasonable to expect a permanent fix for this to be released; however, suggestions for a PHP 8.2 compliant code update that can be applied would be appreciated.

Remaining tasks

Offer PHP 8.2 compliant code update.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇬🇧United Kingdom stevewilson

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

Comments & Activities

Production build 0.71.5 2024