PHP8 TypeError: Unsupported operand types: float + string in TCPDF->Write()

Created on 20 April 2023, over 1 year ago

Problem/Motivation

I was getting this error while using the module with TCPDF library version 6.6.2

TypeError: Unsupported operand types: float + string in TCPDF->Write() (line 6442 of ... /tcpdf/tcpdf.php).

The issue has been solved by the following modification to line 6442 of tcpdf.php:
from this
$maxy = $this->y + $maxh - max($row_height, $h);
to this
$maxy = $this->y + (float)$maxh - max($row_height, $h);

I have filed the issue at TCPDF github page here:
https://github.com/tecnickcom/TCPDF/issues/608

Proposed resolution

Maybe a warning should be added in the documentation about this issue?

🐛 Bug report
Status

Needs review

Version

3.0

Component

Documentation

Created by

🇬🇷Greece arx-e

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024