Error server app "message":"abs(): Passing null to parameter #1 ($num) of type int|float is deprecated

Hi,
When running one of my server actions and also on the front app page, I get the following error in inspector and obviously breaking the page.

"......../dmxConnectLib/lib/formatters/date.php",
"line": 44,
"message": "abs(): Passing null to parameter #1 ($num) of type int|float is deprecated",
It works fine in PHP 7.4.33, but it doesnt after v8 onwards.

Is this a known issue? Or is there a fix. I have the updated version of Wappler.

You probably did not pass the 2nd parameter for the dateAdd formatter. Will add an extra check and default value to prevent the error in the future.

its was a dynamic value from the DB to add a certain number of hours to the date field.It worked fine in PHP 7# but not in PHP 8#

PHP 8 became a lot more strict, in PHP 7 null values where automatically casted as 0 when a number was expected, in PHP 8 you get a warning that it has an invalid type.

Your database probably returned a null value in some specific record causing this error.

Fixed in Wappler 6.8.0

1 Like

This topic was automatically closed after 12 hours. New replies are no longer allowed.