Problem with showColumns for API.get method #3868

Closed
zawadzinski opened this Issue Apr 3, 2013 · 2 comments

3 participants

@zawadzinski

The problem is when specifying showColumns parameter to API.get method.

e.g.

http://demo.piwik.org/index.php?module=API&method=API.get&showColumns=nb_uniq_visitors,nb_pageviews,bounce_rate&idSite=7&period=day&date=2013-04-03&format=JSON

Trace:

<div style='word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;'>
        <strong>There is an error. Please report the message (Piwik 1.12-b4)
        and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
        Notice:</strong> <i>Undefined index: metrics</i> in <b>/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php</b> on line <b>1063</b>
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
#0  Piwik_ErrorHandler(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php:1063]<br />
#1  Piwik_API_API-&gt;get(...) called at [:]<br />
#2  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Proxy.php:187]<br />
#3  Piwik_API_Proxy-&gt;call(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Request.php:121]<br />
#4  Piwik_API_Request-&gt;process(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/Controller.php:25]<br />
#5  Piwik_API_Controller-&gt;index(...) called at [:]<br />
#6  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/FrontController.php:125]<br />
#7  Piwik_FrontController-&gt;dispatch(...) called at [/home/piwik-demo/www/demo.piwik.org/index.php:47]</div><br />
 </pre></div><br />
<div style='word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;'>
        <strong>There is an error. Please report the message (Piwik 1.12-b4)
        and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
        Warning:</strong> <i>Invalid argument supplied for foreach()</i> in <b>/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php</b> on line <b>1063</b>
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
#0  Piwik_ErrorHandler(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php:1063]<br />
#1  Piwik_API_API-&gt;get(...) called at [:]<br />
#2  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Proxy.php:187]<br />
#3  Piwik_API_Proxy-&gt;call(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Request.php:121]<br />
#4  Piwik_API_Request-&gt;process(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/Controller.php:25]<br />
#5  Piwik_API_Controller-&gt;index(...) called at [:]<br />
#6  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/FrontController.php:125]<br />
#7  Piwik_FrontController-&gt;dispatch(...) called at [/home/piwik-demo/www/demo.piwik.org/index.php:47]</div><br />
 </pre></div><br />{"nb_uniq_visitors":813,"nb_pageviews":1743}
@diosmosis
Piwik Open Source Analytics member

In 08cfe92: Fixes #3868, make sure show/hideColumns query params affect metrics when report metadata doesn't provide a translation for metrics, and make sure if no columns are displayed for a report, API.get doesn't fail.

@anonymous-piwik-user

I am also having this problem.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment