@zawadzinski opened this Issue on April 3rd 2013 Contributor

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 />
<a href='/0'>#0</a>  Piwik_ErrorHandler(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php:1063]<br />
<a href='/1'>#1</a>  Piwik_API_API-&gt;get(...) called at [:]<br />
<a href='/2'>#2</a>  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Proxy.php:187]<br />
<a href='/3'>#3</a>  Piwik_API_Proxy-&gt;call(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Request.php:121]<br />
<a href='/4'>#4</a>  Piwik_API_Request-&gt;process(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/Controller.php:25]<br />
<a href='/5'>#5</a>  Piwik_API_Controller-&gt;index(...) called at [:]<br />
<a href='/6'>#6</a>  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/FrontController.php:125]<br />
<a href='/7'>#7</a>  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 />
<a href='/0'>#0</a>  Piwik_ErrorHandler(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/API.php:1063]<br />
<a href='/1'>#1</a>  Piwik_API_API-&gt;get(...) called at [:]<br />
<a href='/2'>#2</a>  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Proxy.php:187]<br />
<a href='/3'>#3</a>  Piwik_API_Proxy-&gt;call(...) called at [/home/piwik-demo/www/demo.piwik.org/core/API/Request.php:121]<br />
<a href='/4'>#4</a>  Piwik_API_Request-&gt;process(...) called at [/home/piwik-demo/www/demo.piwik.org/plugins/API/Controller.php:25]<br />
<a href='/5'>#5</a>  Piwik_API_Controller-&gt;index(...) called at [:]<br />
<a href='/6'>#6</a>  call_user_func_array(...) called at [/home/piwik-demo/www/demo.piwik.org/core/FrontController.php:125]<br />
<a href='/7'>#7</a>  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 commented on April 17th 2013 Member

In 08cfe92f278e987fb43ca6584b1822d61774dceb: 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 commented on April 23rd 2013

I am also having this problem.

This Issue was closed on April 23rd 2013
Powered by GitHub Issue Mirror