I’m trying to use the PDFReports module of the piwik API, specifically PDFReports.addReport. I tried the following in my browser for testing, but it I am receiving an error. Does anyone know if this is a bug or do I have something incorrect?
The screenshot and the text I copied into the last post shows everything I get. I’m not getting a full stack trace. I tried it in Firefox, perhaps another browser would show something different?
There is an error. Please report the message (Piwik 1.12)
and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).
Warning:Invalid argument supplied for foreach() in C:\inetpub\wwwroot\piwik\plugins\PDFReports\API.php on line 577
Backtrace -->
#0 Piwik_ErrorHandler(...) called at [C:\inetpub\wwwroot\piwik\plugins\PDFReports\API.php:577]
#1 Piwik_PDFReports_API::validateReportParameters(...) called at [C:\inetpub\wwwroot\piwik\plugins\PDFReports\API.php:94]
#2 Piwik_PDFReports_API->addReport(...) called at [:]
#3 call_user_func_array(...) called at [C:\inetpub\wwwroot\piwik\core\API\Proxy.php:188]
#4 Piwik_API_Proxy->call(...) called at [C:\inetpub\wwwroot\piwik\core\API\Request.php:145]
#5 Piwik_API_Request->process(...) called at [C:\inetpub\wwwroot\piwik\plugins\API\Controller.php:25]
#6 Piwik_API_Controller->index(...) called at [:]
#7 call_user_func_array(...) called at [C:\inetpub\wwwroot\piwik\core\FrontController.php:125]
#8 Piwik_FrontController->dispatch(...) called at [C:\inetpub\wwwroot\piwik\index.php:47]
The error occured because I was not passing in parameters as an array. The same goes for reports. Below is an example that will work correctly. Thanks for the help Matt!