Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error when trying to request historical data #3533

Closed
tsteur opened this issue Nov 11, 2012 · 9 comments
Closed

Fatal Error when trying to request historical data #3533

tsteur opened this issue Nov 11, 2012 · 9 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Nov 11, 2012

Hi,

In Piwik Mobile I'm trying to open a graph within Search Engine Subtable and I get a fatal error. Almost all subtable evolution graphs are working except Search Engines. I'm not sure if other fail too.

Fatal error: Call to undefined method Piwik_DataTable_Array::getRowFromIdSubDataTable() in /home/piwik/www/demo.piwik.org/plugins/Referers/API.php on line 156

Graph URL:

http://demo.piwik.org/index.php?module=API&method=ImageGraph.get&idSite=7&apiModule=Referers&apiAction=getKeywordsFromSearchEngineId&token_auth=anonymous&period=year&date=2003-01-01,2012-12-31&idSubtable=1491&filter_sort_column=nb_visits&column=nb_visits&columns=nb_visits&token_auth=anonymous&idSite=7&language=en&

The ImageGraphEvolutionUrl is generated here:

http://demo.piwik.org/index.php?idSite=7&date=today&hideMetricsDoc=1&filter_sort_column=nb_visits&apiModule=Referers&apiAction=getKeywordsFromSearchEngineId&period=year&idSubtable=1490&filter_limit=30&module=API&token_auth=anonymous&format=json&method=API.getProcessedReport&language=en&

If you access the API directly you get the same error :

http://demo.piwik.org/index.php?module=API&method=Referers.getKeywordsFromSearchEngineId&idSite=7&token_auth=anonymous&period=year&date=2003-01-01,2012-12-31&idSubtable=1491

It should be possible to query this API with period=year&date=2003-01-01,2012-12-31 because it works for other reports such as getKeywords :

http://demo.piwik.org/index.php?module=API&method=Referers.getKeywords&idSite=7&token_auth=anonymous&period=year&date=2003-01-01,2012-12-31

@sgiehl
Copy link
Member

sgiehl commented Apr 6, 2013

The method getKeywordsFromSearchEngineId doesn't handle datatable arrays correct. I'll fix that. Btw. calling this method that way doesn't make that much sense as the method only returns the requested subtable which means all other periods will stay empty.

@sgiehl
Copy link
Member

sgiehl commented Apr 6, 2013

In e043f90: fixes #3533 fixed fatal. api couldn't handle datatable arrays

@mattab
Copy link
Member

mattab commented Apr 7, 2013

Stefan can you revert please?

-> It does not work, by design, to call &idSubtable and also request multiple periods. the idSubtable is the id of the row in that particular archive, and wont work across dates.

Thomas, can you check if the other reports work? I would expect them not to work for sub-tables using the &idSubtable...

To fix this, proposal:

  • the graphs URL use &label=Google to plot all Keywords from google, or &label=Type to plot all custom variable values for the custom var called "Type" (would plot "Admin", "Reader", "Anon", "member")
    • instead of using &idSubtable= (current)

It will then work across archives/dates. It requires some code changes as I just tried and it does not work yet to set &label instead of &idSubtable.

@sgiehl
Copy link
Member

sgiehl commented Apr 7, 2013

I wouldn't revert the change as it fixes a possible fatal which shouldn't occur - even if the call can't return any usefull data.

@tsteur
Copy link
Member Author

tsteur commented Apr 7, 2013

Looks like graphs from other reports are not working either.

I think it is only a problem when period!=range? Or also when period=range?

BTW: Not only graph URLs are using "&idSubtable" + date range. Also a normal report is using &idSubtable since it is possible to select any date range for any subtable in Piwik Mobile. Period is "range" in this case and this seems to work fine.

@mattab
Copy link
Member

mattab commented Apr 8, 2013

+1 for fixing the fatal error, maybe throwing an exception eg. "Unsupported parameter combination; try removing &idSubtable= or change the $date parameter" or similar message

@mattab
Copy link
Member

mattab commented Apr 8, 2013

Replying to tsteur:

I think it is only a problem when period!=range? Or also when period=range?
BTW: Not only graph URLs are using "&idSubtable" + date range. Also a normal report is using &idSubtable since it is possible to select any date range for any subtable in Piwik Mobile. Period is "range" in this case and this seems to work fine.

do you mean the graph generates? can you send me the URL of a graph generating with &idSubtable value? I would expect it not to work in all cases...

@mattab
Copy link
Member

mattab commented Feb 1, 2014

This looks fixed

@tsteur tsteur added this to the 2.1 - Piwik 2.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants