mateusznitka / protocolsmanager

GLPI Plugin to report users inventory
8 stars 13 forks source link

Uncaught Exception TypeError: #19

Open Giudy opened 3 years ago

Giudy commented 3 years ago

Hi, I'm getting this error while generating the pdf:

[2020-12-03 09:40:22] glpiphplog.CRITICAL: *** Uncaught Exception TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /glpi/plugins/protocolsmanager/dompdf/src/Css/Style.php at line 3086 Backtrace : .../protocolsmanager/dompdf/src/Css/Style.php:3086 round() ...s/protocolsmanager/dompdf/src/Css/Style.php:858 Dompdf\Css\Style->set_z_index() ...s/protocolsmanager/dompdf/src/Css/Style.php:917 Dompdf\Css\Style->set() ...ns/protocolsmanager/dompdf/src/Renderer.php:178 Dompdf\Css\Style->get() ...lsmanager/dompdf/src/FrameReflower/Page.php:148 Dompdf\Renderer->render() ...c/FrameDecorator/AbstractFrameDecorator.php:895 Dompdf\FrameReflower\Page->reflow() plugins/protocolsmanager/dompdf/src/Dompdf.php:856 Dompdf\FrameDecorator\AbstractFrameDecorator->reflow() ...ins/protocolsmanager/inc/generate.class.php:454 Dompdf\Dompdf->render() plugins/protocolsmanager/front/generate.form.php:6 PluginProtocolsmanagerGenerate::makeProtocol()

glpi 9.5.3, php 8

if I transform the line 3086 of the file glpi/plugins/protocolsmanager/dompdf/src/Css/Style.php from:

if (round($val) != $val && $val !== "auto") {*

to

if ($val != $val && $val !== "auto") {

it works but I'm not sure of all the implications of this change

davide

mateusznitka commented 3 years ago

Hi, Maybe it's problem related to PHP 8 and dompdf library, I will test it soon and try to help.

MN