This seems to be broken for me on demo2 https://demo2.matomo.org/index.php?module=CoreAdminHome&action=generalSettings&idSite=1&period=day&date=yesterday and locally but it works on demo.matomo.org
Looks like a regression in a recent change maybe?
When I click on one of these links then it doesn't jump to the correct settings
I'm not able to reproduce that locally. Also not with disabled developer mode and the same set of plugins. It seems somehow the locationchange doesn't trigger the anchorfix on demo2 as calling scrollToAnchorInUrl
manually does the scrolling correctly there.
@diosmosis do you have an idea what this could be caused by?
Unfortunately I don't have access to the settings page on demo2. I can try reproducing locally.
@diosmosis let us know if you need access to demo2 to check that there.
Wasn't able to find the cause but I would look at this code:
https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/CoreHome/angularjs/anchorLinkFix.js#L92-L103
or if removing https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/CoreHome/javascripts/broadcast.js#L405 would work
@tsteur Seems neither me, nor @diosmosis are able to reproduce that locally. So might be hard to find the reason.
@diosmosis I can give you super user access on demo2 if that helps. If you need ssh access to check if some changes are helping, guess @tsteur can help. I don't have ssh access to demo2.
@diosmosis I just gave you super user access. Feel free to check if you can find the reason...
Looks like the $locationChangeStart event is not even triggered. I'm guessing somewhere in angularjs it's not noticing the update to the hash. I've seen this before but wasn't able to non-intrusively fix it.
Comparing between local and demo2, this event handler appears to be missing on demo2:
Might be related.
@sgiehl This line is what fails in demo2 but works locally:
forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });
On demo2 fn
is set to undefined, so nothing is run. Does not at first glance appear to be Vue related.
@sgiehl / @tsteur ok, I can reproduce: if you disable GoogleAnalyticsImporter locally (and potentially any other plugin that uses the $location service in a run/config), the behavior is reproducible. $location
needs to be manually required in a run block so it will be initialized I guess. Or maybe required specifically some other way. (The file that makes it work locally for me is widget-events.run.js.) Do not believe this is Vue related.
@diosmosis good catch. Guess this was caused by migrating some stuff to vue then, as the $location
might not be used anymore. Would it solve the issue to simply inject $location
into e.g. PluginSettings.adapter.ts
?
@sgiehl I think you'd need a run block:
angular.module('piwikApp').run(['$location', function () { }]);
If sticking it in Vue code would put it in MatomoUrl.adapter.ts since it's to get angularjs initialized properly there.
@sgiehl here you go: https://github.com/matomo-org/matomo/pull/18671 since you didn't find time