Division by zero error in graphics (Joe Hunt)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 28 Sep 2010 19:44:37 +0000 (19:44 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 28 Sep 2010 19:44:37 +0000 (19:44 +0000)
CHANGELOG.txt
reporting/includes/class.graphic.inc

index 965aaffa501bac99d80152ce2033ac0a1ef75786..15b9c85b30eff145fd4c9c40cded3268c9cf5c04 100644 (file)
@@ -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
index c1133648eddd578edba73171f450009c6c341760..02af5f2ad97cb4287a4385a07ee0f1554ccb345a 100644 (file)
@@ -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();