Fatal error: Call to a member function getFirstRow() on 1.8.1


after updating from 1.8 to 1.8.1 (both auto-update and fresh install) the dashboard shows the following error message where once was the overview graph (Übersicht mit Graph in german):

Fatal error: Call to a member function getFirstRow() on a non-object in /www/htdocs/w00ebc43/public_html/piwik/plugins/VisitsSummary/Controller.php on line 115

best regards,

Thanks fo rthe report. do you get the erorr for all dates, all websites? or just some dates / some websites?

hi matt,

thanks for your reply. I just updated another site to 1.8.1 and this one doesn’t show the error. the main site however shows it for all kinds of date.

best regards,

For what it’s worth, I am getting a similar error when trying to fix 301 Moved Permanently by adjusting the method declaration (making it public and using $table parameter) and then using the $table parameter instead of $this->table.

For me it helps to remove that widget and add it again. Now it works again.

For it helps to remove that widget and add it again. Now it works again.[/quote]
Same thing here. Removing and re-adding solved the problem. Thank you.

best regards,

OK this is probably the same issue as the Time report showing only 10 reports.

please try to remove and add widget again and it should fix it

Removing and adding widget solves problem. But only for a short time, until user selects one column(metrics) for graph. For example (avg_time_on_site).

  1. Then calling API VisitsSummary.get results in table with single column. avg_time_on_site
  2. After that API\ResponseBuilder collapses it according to

$columns = $dataTable->getFirstRow()->getColumns();
				if(count($columns) == 1)
					$values = array_values($columns);
					return $values[0];

  1. The result is non-object and have no getFirstRow() function

I solved it adding some extra columns to visits summary to be present all the time:

fil: plugins/VisitsSummary/API.php line 62
$columns = array_merge($columns, $tempColumns, array('nb_visits', 'nb_uniq_visitors'));

But it may cause some bugs I believe. So if this bug explanation makes sense - please tell how to fix that correct.


I had the same bug. I’ve removed/added the widget and the bug is gone for now. Please clean fix for a future version :slight_smile: I’m now on Piwik 1.9

Thanks for the report. I added a comment in the ticket: getUsersAccessFromSite has a different behaviour if only one member · Issue #3349 · matomo-org/matomo · GitHub