diff options
Diffstat (limited to 'core/API/DataTablePostProcessor.php')
-rw-r--r-- | core/API/DataTablePostProcessor.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/API/DataTablePostProcessor.php b/core/API/DataTablePostProcessor.php index c2fdd1569c..c4eb7441d0 100644 --- a/core/API/DataTablePostProcessor.php +++ b/core/API/DataTablePostProcessor.php @@ -170,6 +170,12 @@ class DataTablePostProcessor public function applyFlattener($dataTable) { if (Common::getRequestVar('flat', '0', 'string', $this->request) == '1') { + // skip flattening if not supported by report and remove subtables only + if ($this->report && !$this->report->supportsFlatten()) { + $dataTable->filter('RemoveSubtables'); + return $dataTable; + } + $flattener = new Flattener($this->apiModule, $this->apiMethod, $this->request); if (Common::getRequestVar('include_aggregate_rows', '0', 'string', $this->request) == '1') { $flattener->includeAggregateRows(); |