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.9k stars 2.65k forks source link

unexpected website was found after deleting website #15710

Open Findus23 opened 4 years ago

Findus23 commented 4 years ago
  1. view a report for a siteid
  2. go to website management
  3. delete this website (e.g. 26)
  4. notice that the URL is still https://matomo.example/index.php?module=SitesManager&action=index&idSite=26&period=month&date=today&showaddsite=false
  5. Go to an admin page that depends on the siteid like e.g. Tracking Code
  6. An unexpected website was found in the request: website id was set to '26' . (as the siteID in the URL is still 26 which doesn't exist anymore
sgiehl commented 4 years ago

@Findus23 was 26 your lowest page id?

sgiehl commented 4 years ago

ah no. Seems that's an edge case. That seems to happen when you remove the only site that is currently displayed in the sitesmanager list (e.g. last page in pagination). If there is another page displayed, it will be switched to that page. See https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/SitesManager/angularjs/sites-manager/sites-manager-site.controller.js#L192-L208