So, I've been running 5.1.0 for a long time. I only recently got around to upgrading to 5.6.1 using Composer.
- I updated my development machine [windows 10 xampp php 7.4], tested a few reports. All looked good.
- I updated my test webserver [centos 7, php 7.4], tested a few reports. All looked good.
- Same with production webserver [identical to test server]. All looked good.
However, I have a small subset of reports that just will not show any data. I reverted back to 5.1.0 and the reports ran correctly. Upgraded again to 5.6.1 and reports run but do not show any data without any errors on the webpage nor in the console.
I've emptied the kool-reports assets folder, just in case there are conflicts, I've cleared browser caches etc. I've var_dumped the datastore result and can see the expected data. It's just that the data won't display in the DataTable on a small subset of reports.
Most of my reports are identical in format.
1. Run the SQL [mysqli]
2. The view links the datastore result object to the DataGrid/DataTable.
3. Each view has a datagrid\DataTables, inputs\BSelect and two inputs\DateTimePicker.
4. My problem reports also have a google\ColumnChart but the problem persists even if I remove all traces of the chart.
It may be a co-incidence but on my problem reports, if I only select 10 or less items from the BSelect, data then appears in the DataTable.
My view is relatively standard and is below
I notice that the changelog for 5.6.1 mentions some changes for DataStore related to php 8.1. Maybe this has effected it somehow?
Has anything like this come up before? It's taking me so much time to work this out. Besides anything above, my reports work on 5.1.0 but some of them do not on 5.6.1.
<?php
use \koolreport\datagrid\DataTables;
use \koolreport\widgets\google\ColumnChart;
use \koolreport\inputs\BSelect;
use \koolreport\inputs\DateTimePicker;
?>
<div class="row">
<div class="col-md-4">
<form method="post">
<div class="row">
<div class="col-md-4 form-group">
<center><p class="bg-primary">Sites</p></center>
<?php
BSelect::create(array(
"name"=>"siteSelect",
"placeholder"=>"Select Site",
"multiple"=>true,
"dataStore"=>$this->dataStore("names_result"),
"dataBind"=>"site_name",
"attributes"=>array(
"size"=>10,
),
'options' => array(
'numberDisplayed' => 5,
'includeSelectAllOption' => true
)
));
?>
</div>
<div class="col-md-8 form-group">
<div class="col-md-6">
<center><p class="bg-primary">From Date</p></center>
<?php
DateTimePicker::create(array(
"name"=>"startDatePicker",
"maxDate"=>"@endDatePicker",
"format"=>"DD/MM/YYYY HH:mm"
));
?>
</div>
<div class="col-md-6">
<center><p class="bg-primary">To Date</p></center>
<?php
DateTimePicker::create(array(
"name"=>"endDatePicker",
"minDate"=>"@startDatePicker",
"format"=>"DD/MM/YYYY HH:mm"
));
?>
</div>
</div>
</div><div class="row">
<div class="col-md-4 form-group text-center">
<button class="btn btn-success pull-left"><i class="glyphicon glyphicon-refresh"></i> Refresh</button>
</div></div>
</form>
</div>
<div class="col-md-4"">
<h1><center>Daily Footfall Detail</center></h1>
</div>
<div class="col-md-4" style="margin:1px;padding:0px"> </div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<center><p class="bg-primary">Daily Footfall Detail - Between <?php echo $this->params["startDatePicker"] ;?> and <?php echo $this->params["endDatePicker"] ;?></p></center>
<?php
ColumnChart::create(array(
"dataStore"=>$this->dataStore('query_result'),
"width"=>"100%",
"height"=>"250px",
"columns"=>array(
"EntryDate"
,"Daily Total"
)
));
?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php
DataTables::create(array(
"dataStore"=>$this->dataStore('query_result')
,"showFooter"=>"bottom"
,"cssClass"=>array(
"table"=>"table table-hover table-bordered",
"th"=>"cssHeader",
"tr"=>"cssItem"
)
,"options"=>array(
"colReorder"=>true,
"fixedHeader"=>true,
"select"=>true,
"info"=>false,
)
));
?>
</div>
</div>