From 365ff18cab365fa49c0d9d68fe888ea3aa973619 Mon Sep 17 00:00:00 2001 From: Aishwarya Date: Fri, 8 May 2020 19:44:30 +0530 Subject: [PATCH] Bug #159949 fix : Frontend - Demosite - Warning displayed on Vendor Reports page --- tjreports/site/models/reports.php | 14 +++++++++----- tjreports/site/views/reports/view.base.php | 7 ++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tjreports/site/models/reports.php b/tjreports/site/models/reports.php index 4385512..1753132 100755 --- a/tjreports/site/models/reports.php +++ b/tjreports/site/models/reports.php @@ -559,13 +559,17 @@ protected function populateState($ordering = '', $direction = 'ASC') if (empty($colToshow)) { $reportParams = $this->getReportParams($reportId); - $colToshow = (array) $reportParams->get("colToshow"); - $piiColumns = (array) $reportParams->get("piiColumns"); - $piiColumns = array_flip($piiColumns); - if (!empty($piiColumns)) + if(!empty($reportParams['data'])) { - $colToshow = (object) array_diff_key($colToshow, $piiColumns); + $colToshow = (array) $reportParams->get("colToshow"); + $piiColumns = (array) $reportParams->get("piiColumns"); + $piiColumns = array_flip($piiColumns); + + if (!empty($piiColumns)) + { + $colToshow = (object) array_diff_key($colToshow, $piiColumns); + } } } diff --git a/tjreports/site/views/reports/view.base.php b/tjreports/site/views/reports/view.base.php index a355165..fe4a272 100644 --- a/tjreports/site/views/reports/view.base.php +++ b/tjreports/site/views/reports/view.base.php @@ -183,7 +183,12 @@ public function processData($type = 'html') // Array_key - defaultColToHide column are present then get the key as value. $defaultColToHide = (array) $this->model->getState('defaultColToHide'); - $this->defaultColToHide = array_keys($defaultColToHide); + + if(!empty($defaultColToHide)) + { + $this->defaultColToHide = array_keys($defaultColToHide); + } + $this->columns = $this->model->columns; /* Array_merge - here colToshow means get all true value array so want to mearg defaultColToHide column and then using