diff --git a/install-dev/data/theme.sql b/install-dev/data/theme.sql index e393888dc..473042a67 100644 --- a/install-dev/data/theme.sql +++ b/install-dev/data/theme.sql @@ -125,7 +125,7 @@ UPDATE `PREFIX_hook_module` SET position = 5 WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockmyaccountfooter') AND id_hook = @id_hook; -UPDATE `PREFIX_hook_module` SET position = 3 +UPDATE `PREFIX_hook_module` SET position = 6 WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcontactinfos') AND id_hook = @id_hook; diff --git a/modules/dashtrends/dashtrends.php b/modules/dashtrends/dashtrends.php index dcd76b0bc..7581ebaed 100644 --- a/modules/dashtrends/dashtrends.php +++ b/modules/dashtrends/dashtrends.php @@ -238,15 +238,18 @@ class Dashtrends extends Module $chart_data = array(); foreach (array_keys($this->dashboard_data) as $chart_key) { - $calibration = array_sum($this->dashboard_data[$chart_key]) / count($this->dashboard_data[$chart_key]); + $chart_data[$chart_key] = $chart_data_compare[$chart_key] = array(); + + if (!$count = count($this->dashboard_data[$chart_key])) + continue; + + $calibration = array_sum($this->dashboard_data[$chart_key]) / $count; - $chart_data[$chart_key] = array(); foreach ($this->dashboard_data[$chart_key] as $key => $value) $chart_data[$chart_key][] = array(1000 * $key, $calibration ? 100 * $value / $calibration : 0); if ($this->dashboard_data_compare) { - $chart_data_compare[$chart_key] = array(); foreach ($this->dashboard_data_compare[$chart_key] as $key => $value) $chart_data_compare[$chart_key][] = array(1000 * $key, $calibration ? 100 * $value / $calibration : 0); }