KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Fatal Error #563

Closed michele opened this topic on on Dec 17, 2018 - 8 comments

michele commented on Dec 17, 2018

After upgrade, i have this error in drilldown:

Fatal error: Uncaught Exception: Datasource of widget must be in functions to receive params and scope in /home/yyyyy/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/packages/drilldown/DrillDown.php

Stack trace: #0 /home/forge/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/packages/drilldown/DrillDown.tpl.php(33): koolreport\drilldown\DrillDown->renderCurrentLevel() #1 /home/forge/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/core/Widget.php(706): include('/home/forge/app...') #2 /home/forge/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/packages/drilldown/DrillDown.php(199): koolreport\core\Widget->template('DrillDown') #3 /home/forge/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/core/Widget.php(643): koolreport\drilldown\DrillDown->onRender() #4 /home/forge/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/core/Widget.php(738): koolreport\core\Widget->render() #5 /home/forge/xxxxxxxxxx/protected/controller/frontend/reports/SalesByZones.view.php(133): koolre in /home/forge/xxxxxxxxxx/vendor/koolphp/koolreport/koolreport/packages/drilldown/DrillDown.php on line 161

KoolReport commented on Dec 17, 2018

Dear michele,

We have created a easier and more flexible DrillDown. So the new DrillDown is completely new design and interface. However, to keep everything works, we change the name of old DrillDown to LegacyDrillDown available in the package. So what you need to do is very simple: change the name of DrillDown to LegacyDrillDown. Everything will work like before.

Let us know if you need further assistance.

michele commented on Dec 18, 2018

now all report are working excepts one, which gives this error:

Fatal error: Uncaught Error: Cannot use object of type Closure as array in /home/forge/app. xxxxxxxxxx.it/protected/controller/frontend/reports/SalesByZones.view.php:60 Stack trace: #0 [internal function]: koolreport\KoolReport->{closure}(Object(Closure)) #1 /home/forge/app. xxxxxxxxxx.it/vendor/koolphp/koolreport/koolreport/core/Widget.php(404): call_user_func_array(Object(Closure), Array) #2 /home/forge/app. xxxxxxxxxx.it/vendor/koolphp/koolreport/koolreport/core/Widget.php(517): koolreport\core\Widget->standadizeDataSource(Object(Closure)) #3 /home/forge/app. xxxxxxxxxx.it/vendor/koolphp/koolreport/koolreport/packages/drilldown/LegacyDrillDown.php(91): koolreport\core\Widget->useDataSource(Array) #4 /home/forge/app. xxxxxxxxxx.it/vendor/koolphp/koolreport/koolreport/core/Widget.php(121): koolreport\drilldown\LegacyDrillDown->onInit() #5 /home/forge/app. xxxxxxxxxx.it/vendor/koolphp/koolreport/koolreport/core/Widget.php(729): koolreport\core\Widget->__construct(Array) #6 /home/forge/app. xxxxxxxxxx.it/protected/controll in /home/forge/app. xxxxxxxxxx.it/protected/controller/frontend/reports/SalesByZones.view.php on line 60

michele commented on Dec 18, 2018

Code is:

LegacyDrillDown::create(array(
    "name"=>"saleDrillDown",
    "title"=>"Report Zone",
    "btnBack"=>true,
    "scope"=>array(
        "categories"=>$this->params["categories"]
    ),
    "dataSource"=>function($scope)
    {
        return  $this->src("sales")
            ->query("SELECT s.zone_number, DATE(appointment_date) AS adate FROM appointments a join services s on s.id=a.service_id WHERE a.service_id IN (:categories) AND a.status='paid' AND a.company_id=".CURRENT_LOGIN_COMPANY_ID)
            ->params(array(
                ":categories"=>$scope['categories']
            ))
            ->pipe(new CopyColumn(array(
                "year"=>"adate",
                "month"=>"adate",
                "day"=>"adate",
            )))
            ->pipe(new DateTimeFormat(array(
                "year"=>"Y",
                "month"=>"m",
                "day"=>"d",
            )));
    },
KoolReport commented on Dec 18, 2018

The issue seems weird, I have sent your case to dev.team to investigate. Please allow us 1 day to simulate your case and I will come back to you. Can I send updated code through your email if any ( we just want to make sure everything works at your side) before release new update in this month.

KoolReport commented on Dec 18, 2018

By the way, it is highly recommended that you change to new DrillDown. The new DrillDown is much faster and more flexible ( you may customize level display and provide custom query on each levels).

michele commented on Dec 18, 2018

ok, thanks, i'll wait for your mail. I will update to new drilldown later next month. Thanks

KoolReport commented on Dec 18, 2018

The dev.team has spotted out one of issue that may affect LegacyDrillDown. I have sent you email containing new Widget.php, could you please replace the old file with the new file to see if LegacDrillDown works. Please let me know.

michele commented on Dec 18, 2018

Solved, thanks a lot.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

DrillDown