Skip to content
Extraits de code Groupes Projets
Valider cfe56a0a rédigé par mattab's avatar mattab
Parcourir les fichiers

Display useful message when period or label is invalid

parent 21829729
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -420,7 +420,7 @@ class Url ...@@ -420,7 +420,7 @@ class Url
/** /**
* Converts an array of parameters name => value mappings to a query * Converts an array of parameters name => value mappings to a query
* string. * string. Values must already be URL encoded before you call this function.
* *
* @param array $parameters eg. `array('param1' => 10, 'param2' => array(1,2))` * @param array $parameters eg. `array('param1' => 10, 'param2' => array(1,2))`
* @return string eg. `"param1=10&param2[]=1&param2[]=2"` * @return string eg. `"param1=10&param2[]=1&param2[]=2"`
......
...@@ -11,11 +11,11 @@ namespace Piwik\Plugins\CoreHome\DataTableRowAction; ...@@ -11,11 +11,11 @@ namespace Piwik\Plugins\CoreHome\DataTableRowAction;
use Exception; use Exception;
use Piwik\API\DataTablePostProcessor; use Piwik\API\DataTablePostProcessor;
use Piwik\API\Request; use Piwik\API\Request;
use Piwik\API\ResponseBuilder;
use Piwik\Common; use Piwik\Common;
use Piwik\DataTable; use Piwik\DataTable;
use Piwik\Date; use Piwik\Date;
use Piwik\Metrics; use Piwik\Metrics;
use Piwik\Period\Factory as PeriodFactory;
use Piwik\Piwik; use Piwik\Piwik;
use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz; use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz;
use Piwik\Url; use Piwik\Url;
...@@ -95,7 +95,7 @@ class RowEvolution ...@@ -95,7 +95,7 @@ class RowEvolution
if ($this->label === '') throw new Exception("Parameter label not set."); if ($this->label === '') throw new Exception("Parameter label not set.");
$this->period = Common::getRequestVar('period', '', 'string'); $this->period = Common::getRequestVar('period', '', 'string');
if (empty($this->period)) throw new Exception("Parameter period not set."); PeriodFactory::checkPeriodIsEnabled($this->period);
$this->idSite = $idSite; $this->idSite = $idSite;
$this->graphType = $graphType; $this->graphType = $graphType;
...@@ -146,7 +146,7 @@ class RowEvolution ...@@ -146,7 +146,7 @@ class RowEvolution
$parameters = array( $parameters = array(
'method' => 'API.getRowEvolution', 'method' => 'API.getRowEvolution',
'label' => $this->label, 'label' => urlencode($this->label),
'apiModule' => $apiModule, 'apiModule' => $apiModule,
'apiAction' => $apiAction, 'apiAction' => $apiAction,
'idSite' => $this->idSite, 'idSite' => $this->idSite,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter