@localhorst opened this Issue on August 30th 2019

When opening page overlays and selecting "today" or "yesterday", the page does not load. I get this error in Firefox Console:

Firefox 68.0.2 (64-bit)

TypeError: location.match(...) is nullPiwik_Overlay.js:148:33
    setIframeOrigin https://matomo.mydomain.com/plugins/Overlay/javascripts/Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:148
    hashChangeCallback https://matomo.mydomain.com/plugins/Overlay/javascripts/Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:170
    init https://matomo.mydomain.com/plugins/Overlay/javascripts/Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:278
    invoke https://matomo.mydomain.com/index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:163
    init https://matomo.mydomain.com/plugins/Overlay/javascripts/Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:273
    <anonymous> https://matomo.mydomain.com/index.php?module=Overlay&period=week&date=today&idSite=4:260
    i https://matomo.mydomain.com/index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4
    fireWith https://matomo.mydomain.com/index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4
    ready https://matomo.mydomain.com/index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4
    J https://matomo.mydomain.com/index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4

A similar error occurs in Chrome 76.0.3809.100 (64-Bit)

Uncaught TypeError: Cannot read property '0' of null
    at setIframeOrigin (Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:148)
    at hashChangeCallback (Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:170)
    at Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:278
    at Object.invoke (index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:163)
    at Object.init (Piwik_Overlay.js?cb=b7a7ffc1b1f573a45213fcfecfcdc04d:273)
    at HTMLDocument.<anonymous> (index.php?module=Overlay&period=day&date=today&idSite=4:260)
    at i (index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4)
    at Object.fireWith [as resolveWith] (index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4)
    at Function.ready (index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4)
    at HTMLDocument.J (index.php?module=Proxy&action=getCoreJs&cb=b7a7ffc1b1f573a45213fcfecfcdc04d:4)

~In MS Edge, the page overlay loads fine.~
Microsoft Edge 44.18362.267.0
Edit: No, in Edge it fails with this error:

SCRIPT5007: SCRIPT5007: Unable to get property '0' of undefined or null reference
Piwik_Overlay.js (148,9)

Using Matomo 3.11.0

@sgiehl commented on September 1st 2019 Member

@localhorst What is the querystring / fragment of the url opened for overlay?

@localhorst commented on September 3rd 2019

/index.php?module=Overlay&period=day&date=today&idSite=4
/index.php?module=Overlay&period=day&date=yesterday&idSite=4

@jmumby commented on October 21st 2019

I can create this issue also for day

/index.php?module=Overlay&period=day&date=today&idSite=11

image

@awadhtripathi commented on October 21st 2019

Hi Team, getting error

Piwik_Overlay.js?cb=65bdd64ac8a4f70482648701f8790e20:152 Uncaught TypeError: Cannot read property '0' of null
at Piwik_Overlay.js?cb=65bdd64ac8a4f70482648701f8790e20:152
at Array.map ()
at setIframeOrigin (Piwik_Overlay.js?cb=65bdd64ac8a4f70482648701f8790e20:151)
at hashChangeCallback (Piwik_Overlay.js?cb=65bdd64ac8a4f70482648701f8790e20:170)
at Piwik_Overlay.js?cb=65bdd64ac8a4f70482648701f8790e20:278
at Object.invoke (index.php?module=Proxy&action=getCoreJs&cb=65bdd64ac8a4f70482648701f8790e20:163)
at Object.init (Piwik_Overlay.js?cb=65bdd64ac8a4f70482648701f8790e20:273)
at HTMLDocument. (index.php?module=Overlay&period=month&date=today&idSite=14:260)
at i (index.php?module=Proxy&action=getCoreJs&cb=65bdd64ac8a4f70482648701f8790e20:4)
at Object.fireWith [as resolveWith] (index.php?module=Proxy&action=getCoreJs&cb=65bdd64ac8a4f70482648701f8790e20:4)

@tsteur commented on October 21st 2019 Member

@jmumby in chat can you maybe send me a URL where this can be reproduced? I tried to reproduce on demo but couldn't

@tsteur commented on October 21st 2019 Member

From what I see this happens when changing the date and there was some error before or the overlay was not loaded or something. We could push a workaround maybe (I have some code here) but it wouldn't end up bringing that much since the overlay would just not load again and we need to fix the actual issue. Can anyone confirm this is happening when changing the date and it was actually displaying data in the overlay?

BTW @mattab I suppose https://github.com/matomo-org/matomo/pull/14482 broke the overlay which is also why some experience this issue. Eg the iframe doesn't receive any origin/referrer and can't detect the overlay is being used. I suppose it happens when origin is maybe the same but not when it is different say foo.bar.com is analytics and foo.com is the website.

@mattab commented on October 24th 2019 Member

@Findus23 would it be possible to patch https://github.com/matomo-org/matomo/pull/14482 to not do this while serving Overlay feature, to prevent the issue?

Powered by GitHub Issue Mirror