@anonymous-piwik-user opened this Issue on July 6th 2010

I've moved PHP Piwik logs in a separate file and I'm getting the error in the subject on any hit to the GeoIP plugin (v0.13) data:

https://hostname/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=today#module=GeoIP&action=index&idSite=1&period=day&date=today

The error seems not to have any functional impact (i.e priority low) since I'm able to see the widgets as expected and this is the reason why I never took attention to the error before separating the logs.

Line 871: $row = $this->dataTable->getFirstRow();

Adding some debug lines didn't help me:

...
     */
    public function getColumnsToDisplay()
    {
print('<pre>$this->columnsToDisplay: '.var_export($this->columnsToDisplay, true).'</pre>');
print('<pre>$this->dataTable: '.($this->dataTable instanceof Piwik_DataTable_Array ? 'Piwik_DataTable_Array' : 'false').'</pre>');
        if(empty($this->columnsToDisplay))
        {
            $row = $this->dataTable->getFirstRow();
...

'cause I get:

// Country (GeoIP)
$this->columnsToDisplay: array (
  0 => 'label',
  1 => 'nb_uniq_visitors',
)

$this->dataTable: false

$this->columnsToDisplay: array (
  0 => 'label',
  1 => 'nb_uniq_visitors',
)

$this->dataTable: false
...
// Provider
$this->columnsToDisplay: array (
  0 => 'label',
  1 => 'nb_uniq_visitors',
)

$this->dataTable: false

Keywords: GeoIP Piwik_DataTable_Array

@anonymous-piwik-user commented on July 6th 2010

v0.14 fixed this minor issue:

--- GeoIP\GeoIP-0.13\GeoIP\Controller.php   Wed Jul 29 02:52:00 2009 UTC
+++ GeoIP\GeoIP-0.14\GeoIP\Controller.php   Tue Jun 29 12:20:06 2010 UTC
@@ -67,7 +67,9 @@

    function getLastDistinctCountriesGraph( $fetch = false )
    {
-       $view = $this->getLastUnitGraph('GeoIP',__FUNCTION__, "GeoIP.getNumberOfDistinctCountries");
+       $view = $this->getLastUnitGraph('UserCountry',__FUNCTION__, "GeoIP.getNumberOfDistinctCountries");
+       // Note: this shouldn't be 0 there, but somehow the column name is not recorded properly
+       $view->setColumnsToDisplay('0');
        return $this->renderView($view, $fetch);
    }
 }

Apologies for opening this ticket w/o testing before the last GeoIP plugin version!

@mattab commented on July 6th 2010 Member

im closing assuming it's working fine. please comment if you still see issues

This Issue was closed on July 6th 2010
Powered by GitHub Issue Mirror