Report filtering doesn't work

Created on 13 June 2023, over 1 year ago
Updated 16 June 2023, over 1 year ago

Problem/Motivation

When you visit "admin/reports/matomo-reports" you will receive the widget with URL (more or less)
XXX/index.php?module=Widgetize&action=iframe&containerId=VisitOverviewWithGraph&disableLink=1&widget=1&moduleToWidgetize=CoreHome&actionToWidgetize=renderWidgetContainer&idSite=111111111&period=day&date=today

The problem is when filtering the code only returns a period for "0" or "1".

-    if ($period == 1) {
-      // Special handling for "yesterday" = 1.
-      // The yesterday date value is required.
-      $date = $this->selectPeriod($period);
-    }
-    else {
-      // Otherwise it returns the today date value.
-      $date = $this->selectPeriod(0);
-    }

This doesn't seem right (so month, year, week) are never returned. Also the code if returning the correct "number" doesn't produce the correct strtotime result.

This has been resolved in attached merge request with some rewrites to the code.

Steps to reproduce

Open up admin/reports/matomo-reports, filter "last month".
the results don't reflect the result via the "real" matomo dashboad/website.

Remaining tasks

review

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium mschudders

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024