You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the matomo-page section in my Kirby v4 site with the latest version (2.0.1) of this plugin. Some of the pages have custom URLs, configured according to Kirby's documentation. The url() method on these pages is overridden to return the correct (custom) URL, as also instructed in your readme:
Matomo receives public urls, which means that its URIs are fetched once routes have been applied. Therefore, the plugin filters Matomo's responses with a uri created from the public url of the page. If you have set up custom routes, to skip subfolders for example, please make sure to overwrite the url method for the template with a page model, otherwise the uri won't be correct.
However, the widget is not working correctly. I notice the following error:
GET http://site/api/matomo-panel/get-page-metrics?period=month&multilang=false&overview=false&default=false&uri=/page
{
"status": "error",
"message": "Call to a member function url() on null",
"code": 500,
"exception": "Error",
"key": null,
"file": "/site/plugins/matomo/lib/matomo.php",
"line": 171,
"details": [],
"route": "matomo-panel/get-page-metrics"
}
(In this case, /page is my custom URL, and the original URL would be something like /section/page.)
According to my debugging, the plugin tries to find the right page using $pages->find() with the custom URL:
I'm using the
matomo-page
section in my Kirby v4 site with the latest version (2.0.1) of this plugin. Some of the pages have custom URLs, configured according to Kirby's documentation. Theurl()
method on these pages is overridden to return the correct (custom) URL, as also instructed in your readme:However, the widget is not working correctly. I notice the following error:
(In this case,
/page
is my custom URL, and the original URL would be something like/section/page
.)According to my debugging, the plugin tries to find the right page using
$pages->find()
with the custom URL:kirby-matomo/lib/matomo.php
Line 168 in ce5da6b
However, that method finds pages based on their ID, which is not equal to the (overridden/custom) URL.
I'm curious if something is wrong in my configuration, or this is a bug in the plugin.
The text was updated successfully, but these errors were encountered: