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

[GeoIP] Call to undefined method Piwik_DataTable_Array::getFirstRow() in /path/to/piwik-0.6.3/core/ViewDataTable.php on line 871 #1463

Closed
anonymous-matomo-user opened this issue Jul 6, 2010 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@anonymous-matomo-user
Copy link

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-matomo-user
Copy link
Author

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
Copy link
Member

mattab commented Jul 6, 2010

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

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. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

2 participants