From: Joe Hunt Date: Tue, 28 Sep 2010 19:44:37 +0000 (+0000) Subject: Division by zero error in graphics (Joe Hunt) X-Git-Tag: v2.4.2~19^2~607 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=bb0ab44f1e86d16179d45c32bef918a7fc485e1e;p=fa-stable.git Division by zero error in graphics (Joe Hunt) --- 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();