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
Sorting Live.getLastVisitsDetails visits by a custom column #5950
Comments
…an visitors filter immediately (before sort)
Using column I am trying to apply the filter "clean visitors" before sorting but I do not know whether it has any side effects. I reckon one thing could be performance. So far the clean visitors filter was executed after GenericFilters and therefore only on the result set that is actually returned. Now we would execute it on all visitors, even on visitors that might get filtered out by GenericFilters. Also not sure whether still all other GenericFilters and all other use cases would work -> This would be a breaking API change. Maybe we should rather run the sort filter twice and not execute the clean visitors filter immediately. So we would run GenericFilters which includes sort, clean the visitors and run the sort filter again. |
As the UI tests do not work I did some manual testing and also checked Piwik Mobile codebase. There is a Both solutions that I tried change the oder of the VisitorLog slightly since it is now actually able to sort by |
@tsteur Visitor Log should be sorted by (lots of users use the Visitor Log as main reporting tool, and refresh it frequently "today" to see the latest visitors and actions on their website) |
I didn't even think of that... at least now I get it why it didn't work :-)
performance may be an issue, because call to
If this works then maybe it's a good solution? |
Done. Gone with the second solution sorting a second time. I did some manual testing with the VisitorLog as the UI tests were not working (I think the build will work again since I fixed the travis.yml, will now in 30 min :) ). Will merge once the new integration tests pass and once it is in master I will check the UI tests just to keep it simple. |
…an visitors filter immediately (before sort)
refs #5950 add possibility to sort Live.getLastVisitsDetails
Reproduce:
http://demo.piwik.org/index.php?module=API&method=Live.getLastVisitsDetails&idSite=3&period=day&date=yesterday&format=xml&filter_sort_column=lastActionTimestamp&filter_sort_order=asc
lastActionTimestamp
Fixing this issue will make the API more powerful and useful. Today we had to work around it costing 1-2 hours of our life...
The text was updated successfully, but these errors were encountered: