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
Live.getLastVisitsDetails does not accept period=day&date=last10 #9840
Comments
Even if I change the URL to date=today I get the following error: |
For RSS it's normal, switch format to XML and they bug is still the same |
Found another issue regarding strtotime Steps to reproduce: Another example is the following: One would think the API following call: |
FYI: AFAIK There it says re
And it works like this when I apply it eg here: http://demo.piwik.org/?module=API&method=API.get&format=JSON&idSite=7&period=week&date=previous6 It seems to be only limited for CSV/TSV export as this returns an error see http://demo.piwik.org/?module=API&method=API.get&format=CSV&idSite=7&period=week&date=previous6 . It is failing here: https://github.com/piwik/piwik/blob/2.16.2-b2/core/DataTable/Renderer/Csv.php#L309 . I have issued a pull request in #10273 to fix it but I cannot promise it'll be merged as some other tests may fail. |
Yeah, I know I'm pushing it to hard and over it's limit. ;) I'm using last%month and last%20year for a long time now, but never for ranges. oh... and never on the 31st of a month, or the last week of march, because of the month calculation bug that exists in strtotime. If you look at strtotime page that is referenced by the error page that shows up, a lot more 'magic keywords' are available. I was hoping it could be added without to much of a hassle. To be able to use previous6 in months and weeks in csv export would be really helpful. and it would solve my issue, without the use of unsupported magic keywords. |
After deploying the next beta/rc to demo, I will confirm this bug is fixed and close the issue then. |
be aware that I did not provide a fix for this issue, only for the reported CSV issue |
please note that this similar issue also happen when you have set the time to monthly and then click from the "All Websites" on a Website link. As this is made from the UI automatically it should work without error. |
See #9798 (comment)
Can be reproduced with this URL: http://demo.piwik.org/?module=API&method=Live.getLastVisitsDetails&idSite=7&period=day&date=last10&format=json&token_auth=anonymous&translateColumnNames=1
In the example there is
period=day&date=last10
and it results in an errorThe text was updated successfully, but these errors were encountered: