diff options
author | Stefan Giehl <stefan@piwik.org> | 2018-05-10 00:23:22 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2018-05-10 00:23:22 +0300 |
commit | 54d56da35fb5967bfdb034d5adde72a4c0984aa1 (patch) | |
tree | d27ab8a5140ee7c4c18b01eb19b68ffda040635b /plugins/CoreHome/DataTableRowAction | |
parent | a80b0ec2eb83451363e7e55b03d1acbc4c30c8c9 (diff) |
Fix row evolution (#12877)
Diffstat (limited to 'plugins/CoreHome/DataTableRowAction')
-rw-r--r-- | plugins/CoreHome/DataTableRowAction/RowEvolution.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 4f3a5a4375..a241f04321 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -83,10 +83,6 @@ class RowEvolution */ public function __construct($idSite, $date, $graphType = 'graphEvolution') { - if (!($date instanceof Date)) { - throw new Exception("Expected date to be an instance of \\Piwik\\Date"); - } - $this->apiMethod = Common::getRequestVar('apiMethod', '', 'string'); if (empty($this->apiMethod)) { throw new Exception("Parameter apiMethod not set."); @@ -103,6 +99,10 @@ class RowEvolution $this->period = Common::getRequestVar('period', '', 'string'); PeriodFactory::checkPeriodIsEnabled($this->period); + if ($this->period != 'range' && !($date instanceof Date)) { + throw new Exception("Expected date to be an instance of \\Piwik\\Date"); + } + $this->idSite = $idSite; $this->graphType = $graphType; |