Bug found in chart generation 0.5.1

I’ve found a bug in the chart generation code. Users were having trouble viewing graphs in widgets. I believe I’ve tracked it down but could be wrong since I’m not that familiar with Piwik’s code.

core/ViewDataTable/GenerateGraphHTML.php
line 104: $idSite = Piwik_Common::getRequestVar(‘idSite’, 1);

Correct me if I’m wrong but it looks like if a user doesn’t have access to site 1 they won’t get charts inline.

This only effects inline charts. If serve_widget_and_data = 0 charts work fine.

On login, Piwik_Controller will default the idSite to one which the user has view access to. GenerateGraphHTML.php uses ‘1’ if idSite isn’t in the URL request/parameters. My gut feeling is that this isn’t the root cause.

There is an IE issue when reloading/refreshing a page. This is fixed in SVN. See: http://dev.piwik.org/trac/changeset/1663

are you still experiencing this problem in 0.5.4?

I’m keeping serve_widget_and_data disabled for faster page rendering and haven’t tested it enabled. When I have a chance I’ll try it and report back.