@tsteur opened this Issue on January 20th 2022 Member

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
image

@sgiehl commented on January 20th 2022 Member

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?

@diosmosis commented on January 20th 2022 Member

Unfortunately I don't have access to the settings page on demo2. I can try reproducing locally.

@sgiehl commented on January 21st 2022 Member

@diosmosis let us know if you need access to demo2 to check that there.

@diosmosis commented on January 21st 2022 Member
@sgiehl commented on January 21st 2022 Member

@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 commented on January 21st 2022 Member

I have ssh access to demo2 if I need to change anything.

@sgiehl commented on January 21st 2022 Member

@diosmosis I just gave you super user access. Feel free to check if you can find the reason...

@diosmosis commented on January 21st 2022 Member

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.

@diosmosis commented on January 21st 2022 Member

Comparing between local and demo2, this event handler appears to be missing on demo2:

image

Might be related.

@diosmosis commented on January 21st 2022 Member

Something off w/ the angularjs bootstrap logic.

@diosmosis commented on January 21st 2022 Member

@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.

@diosmosis commented on January 21st 2022 Member

Nevermind, that's not the reason... still looking.

@diosmosis commented on January 21st 2022 Member

@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.

@sgiehl commented on January 21st 2022 Member

@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?

@diosmosis commented on January 21st 2022 Member

@sgiehl I think you'd need a run block:

angular.module('piwikApp').run(['$location', function () { }]);
@diosmosis commented on January 21st 2022 Member

If sticking it in Vue code would put it in MatomoUrl.adapter.ts since it's to get angularjs initialized properly there.

@diosmosis commented on January 21st 2022 Member

@sgiehl here you go: https://github.com/matomo-org/matomo/pull/18671 since you didn't find time

This Issue was closed on January 24th 2022
Powered by GitHub Issue Mirror