Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API returned an error: Date format must be..[etc] when generating email report that includes a custom report #10135

Closed
chielteuben opened this issue May 9, 2016 · 5 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@chielteuben
Copy link

I created a custom report following https://developer.piwik.org/guides/custom-reports and https://developer.piwik.org/guides/custom-reports-extended

This report works as expected when requesting the custom API method and also shows up fine in the Visitors subsection within piwik.
Once you select it to be added to the email report with the default display option enabled (so this includes graphs for key metrics) it generates the following image:
index
While still generating the table itself fine right after it.
The full error message would probably be

API returned an error: Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function

but it's cut off due to the text being added to an actual image.
So either I'm missing some crucial step that is required when generating graphs in email reports that is not explained in the docs or I'm running into a bug here.

@tsteur
Copy link
Member

tsteur commented May 10, 2016

Are you using the Live.getLastVisitsDetails like in the guide? I believe the Live API is pretty much the only API that doesn't really work with graphs since it is not an aggregated report.

@chielteuben
Copy link
Author

chielteuben commented May 11, 2016

Yes I am. I have also tried it using a custom db query though. When I create a custom DataTable using that it once again works fine on all the other pages but actually causes the entire email report generation to fail with the following error:

Call to undefined method Piwik\DataTable\Simple::getDataTables() in \htdocs\piwik\plugins\ImageGraph\API.php on line 423

Returning to your original point though, am I supposed to create an archiver to solve this problem?

@tsteur
Copy link
Member

tsteur commented May 12, 2016

Yes you'd be supposed to create an archiver. What kind of data are you looking for? Maybe you can enrich or change an existing report without having to create an archiver which is quite painful at the moment.

@chielteuben
Copy link
Author

I'm retrieving some custom data based on visitor IP ranges and create a custom DataTable using this data.
All of this is working fine, even created a custom dashboard widget. Sadly it all falls apart during the email report generation. I think I'll have to look into creating that archiver.

@tsteur
Copy link
Member

tsteur commented Jun 13, 2016

@chielteuben I'll close the issue for now but let us know in case there is any bug. I know Archivers can be quite painful as they are still complex unfortunately and little documentation.

@tsteur tsteur closed this as completed Jun 13, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants