From bb0ab44f1e86d16179d45c32bef918a7fc485e1e Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 28 Sep 2010 19:44:37 +0000 Subject: [PATCH] Division by zero error in graphics (Joe Hunt) --- CHANGELOG.txt | 2 ++ reporting/includes/class.graphic.inc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 965aaffa..15b9c85b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,8 @@ $ -> Affected files $ /sales/includes/db/sales_order_db.inc # Reference update should not change next reference. $ /includes/references.inc +# Division by zero error in graphics (Joe Hunt) +$ /reporting/includes/class.graphic.inc 27-Sep-2010 Janusz Dobrowolski ! Alowed optional path for $icon parameter in set_icon helper diff --git a/reporting/includes/class.graphic.inc b/reporting/includes/class.graphic.inc index c1133648..02af5f2a 100644 --- a/reporting/includes/class.graphic.inc +++ b/reporting/includes/class.graphic.inc @@ -203,6 +203,8 @@ class graph } $this->sum_total = array_sum($this->y); + if ($this->sum_total == 0) + $this->sum_total = 1; $this->space_between_bars += ($this->graphic_2_exists == true) ? 10 : 0; $this->calculate_higher_value(); -- 2.30.2