KoolReport's Forum

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

"array_keys() expects parameter 1 to be array, null given" #1488

Open paulo opened this topic on on Jun 15, 2020 - 3 comments

paulo commented on Jun 15, 2020

I am getting this error again. It was resolved in the past, but now it is back - can you please take a look? Thank you

Original error: https://www.koolreport.com/forum/topics/1100

array_keys() expects parameter 1 to be array, null given {"userId":3,"exception":"[object] (ErrorException(code: 0): array_keys() expects parameter 1 to be array, null given at /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExportHandler.php:72) [stacktrace] #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'array_keys() ex...', '/home/forge/my....', 72, Array) #1 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExportHandler.php(72): array_keys(NULL) #2 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExportHandler.php(258): koolreport\excel\ExportHandler->getDataStoreType(Object(koolreport\core\DataStore)) #3 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExcelExportable.php(39): koolreport\excel\ExportHandler->exportToExcel(Array) #4 /home/forge/my.ellisontravel.com/app/Http/Controllers/Admin/AdminReportController.php(873): App\Reports\Activities\MyActivitiesReport->exportToExcel() #5 [internal function]: App\Http\Controllers\Admin\AdminReportController->executeReport('Reporting:MYAct...') #6 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #7 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('executeReport', Array) #8 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Admin\AdminReportController), 'executeReport') #9 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController() #10 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\Routing\Route->run() #11 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #12 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #13 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure)) #14 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #15 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(75): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #16 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #17 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #18 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #19 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #20 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #21 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #22 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #23 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #24 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #25 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #26 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #27 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #28 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #29 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #30 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #31 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(682): Illuminate\Pipeline\Pipeline->then(Object(Closure))

David Winterburn commented on Jun 16, 2020

Please let us know:

  1. Your php code for your report and export.
  2. Which version of Excel package you have (this could be seen in file excel/composer.json).

Thanks!

paulo commented on Jun 16, 2020

main composer: "koolreport/blade": "*",

    "koolreport/excel": "*",
    "koolreport/export": "*",
    "koolreport/pro": "*",

Under the Vendor in my local machine I have: {

"name": "koolreport/excel",
"version":"7.1.1",
"description": "Allow KoolReport to connect to Excel and export to excel file",
"keywords": ["PHP","Reporting Tools","Data Report","Charts","Exporting","Microsoft Excel","XLS","Export to Excel"],
"homepage": "https://www.koolreport.com",
"type": "library",
"license": "https://www.koolreport.com/license#mit-license",
"require": {
    "phpoffice/phpspreadsheet": "^1.6",
    "box/spout": "^3.0"
}

}

I'm using Laravel, so I don't deal with the vendor folder at all.

David Winterburn commented on Jun 17, 2020

Do you mind opening the file /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExportHandler.php and post line 72 code here? I don't think there's array_keys on line 72 of Excel version 7.1.1.

Also post version line of the file /home/forge/my.ellisontravel.com/vendor/koolreport/excel/composer.json. Thanks!

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
bug

Export