matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.29k stars 2.59k forks source link

Comparing periods: Changing period type for row evolution graph not works #17582

Open utrautmann opened 3 years ago

utrautmann commented 3 years ago

Summary: Changing the time period for the row evolution graph not works, when I'm comparing two periods for a single page. It leads to an exception.

Steps to reproduce:

  1. Select period "Month" and compare it to "Previous year" in the Date picker above
  2. Goto Behaviour-->Pages and select one page and open "Open row evolution"
  3. Click "Pick a row to compare" and select the same page with the period for the previous year. Now the row evolution opens again.
  4. If I try to select another "time period" for the graph (I try to select "Day" - see screenshot please) then nothing happens (in the background/ Log I find an exception : _Uncaught exception: /is/htdocs/wp11188790QHUN7F9B27/www/piwik/core/Period/Factory.php(131): Der Zeitraum '' wird nicht unterstützt. Versuchen Sie es stattdessen mit einem der folgenden: day, week, month, year, range

grafik

Comparing periods only works in the graph, if the selected period in the date picker above is the same like for the graph,

diosmosis commented 3 years ago

Confirmed this is a bug. Changing the period will only change the current period type, not the period type of the period we are comparing to.

Additionally, changing the period back in the graph, will incorrectly set the date using the end date of the period. So if we have a day, 2021-05-04 compared with 2021-05-03, then change the period to week, 2021-05-04 will change to 2021-05-03,2021-05-09. If we change it back to a day, it becomes 2021-05-09, instead of 2021-05-04.