diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-05-15 04:16:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-15 04:16:29 +0300 |
commit | cecec674a65e4dc2a1aa7c33722a5380be2fd719 (patch) | |
tree | e2958f4ba1bb4a6c3c520c88ca40ec60859484b1 /plugins/CoreVisualizations/Visualizations | |
parent | 045b3c6d936b39ca25623ca40b8ba6b4143f14ba (diff) |
Allow throwing exceptions for HTTP error codes to better check query param input. (#14023)
* Allow throwing exceptions for HTTP error codes to better check query param input.
* Add multiple period checks to visualizations.
* Forgot to add files.
* apply review comments
* Make sure code is set when using HttpCodeException.
Diffstat (limited to 'plugins/CoreVisualizations/Visualizations')
6 files changed, 18 insertions, 0 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php index 1a199b327a..f5c5543116 100644 --- a/plugins/CoreVisualizations/Visualizations/Cloud.php +++ b/plugins/CoreVisualizations/Visualizations/Cloud.php @@ -47,6 +47,11 @@ class Cloud extends Visualization $this->config->show_limit_control = false; } + public function beforeLoadDataTable() + { + $this->checkRequestIsNotForMultiplePeriods(); + } + public function afterAllFiltersAreApplied() { if ($this->dataTable->getRowsCount() == 0) { diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php index 522eed6ae5..2fa6e6674b 100644 --- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php +++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php @@ -37,6 +37,11 @@ class HtmlTable extends Visualization return new HtmlTable\RequestConfig(); } + public function beforeLoadDataTable() + { + $this->checkRequestIsNotForMultiplePeriods(); + } + public function beforeRender() { if ($this->requestConfig->idSubtable diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php b/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php index 536477abb3..9f754eccc4 100644 --- a/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php +++ b/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php @@ -67,6 +67,8 @@ class AllColumns extends HtmlTable public function beforeLoadDataTable() { + parent::beforeLoadDataTable(); + unset($this->requestConfig->request_parameters_to_modify['pivotBy']); unset($this->requestConfig->request_parameters_to_modify['pivotByColumn']); } diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php index 1204ae8a09..122920da2d 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php @@ -25,6 +25,8 @@ class Bar extends JqplotGraph { parent::beforeLoadDataTable(); + $this->checkRequestIsNotForMultiplePeriods(); + $this->config->datatable_js_type = 'JqplotBarGraphDataTable'; } diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php index ae8e260bc1..ec6d4924cf 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php @@ -35,6 +35,8 @@ class Evolution extends JqplotGraph { parent::beforeRender(); + $this->checkRequestIsOnlyForMultiplePeriods(); + $this->config->show_flatten_table = false; $this->config->datatable_js_type = 'JqplotEvolutionGraphDataTable'; } diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php index 42ba69ef3f..32a2f2dfed 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php @@ -34,6 +34,8 @@ class Pie extends JqplotGraph { parent::beforeRender(); + $this->checkRequestIsNotForMultiplePeriods(); + $this->config->show_all_ticks = true; $this->config->datatable_js_type = 'JqplotPieGraphDataTable'; } |