From 0507db75b53dfccf71ea5e20d836bb4085893dc4 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:06:54 +0100 Subject: [PATCH] fix php warning in dolGraph class (#31911) * fix php warning in dolGraph class * remove useless test --------- Co-authored-by: Hystepik --- htdocs/core/class/dolgraph.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 49a2f02f004..ca71e0df442 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -782,6 +782,9 @@ class DolGraph { // phpcs:enable $max = $this->GetMaxValueInData(); + if (!isset($max)) { + $max = 0; + } if ($max != 0) { $max++; } @@ -792,9 +795,7 @@ class DolGraph } $res = 0; - if (is_numeric($max)) { - $res = ceil($max / $factor) * $factor; - } + $res = ceil($max / $factor) * $factor; //print "max=".$max." res=".$res; return (int) $res;