Navigation Menu

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

PDFReports: 'YYYY-MM-DD%2CYYYY-MM-DD' is not a correct date range [Solution included]] #3206

Closed
arminrosu opened this issue Jun 7, 2012 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Milestone

Comments

@arminrosu
Copy link

I had an issue today, trying to send a report (my first time doing so). This was my URL (I've previously set it to display logs in from 09 May - 06 June):

../piwik/index.php?module=PDFReports&action=index&period=range&date=2012-05-09%2C2012-06-06&idSite=1&updated=3#

This then generated the following error:

API returned an error: The date '2012-05-09[b]%2C[/b]2012-06-06' is not a correct date range. It should have the following format: 'lastN', 'previousN', 'YYYY-MM-DD,YYYY-MM-DD'.```


Inspecting the network transmission, it confirmed, that the transmitted date range string (before url encoding) was: "2012-05-09%2C2012-06-06" ("%2C" is a url-encoded comma).

I tracked this down to /piwik/plugins/PDFReports/templates/pdf.js, line 93. Change this:

parameters.date = broadcast.getValueFromUrl('date');```

to this:

parameters.date = decodeURIComponent( broadcast.getValueFromUrl('date') );```

And the problem should be solved
@mattab
Copy link
Member

mattab commented Jun 17, 2012

Thanks for the report!

@diosmosis
Copy link
Member

Matt, is there a reason Piwik_Common::getRequestVar doesn't call urldecode?

@mattab
Copy link
Member

mattab commented Oct 24, 2012

This was fixed in #3387

@arminrosu arminrosu added this to the 1.9.1 - Piwik 1.9.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

3 participants