Problem/Motivation

Error: Call to a member function getRowCount() on array in Drupal\google_analytics_counter\GoogleAnalyticsCounterAppManager->queryTotalPaths() (line 469 of /home1/demo-project/public_html/modules/contrib/google_analytics_counter/src/GoogleAnalyticsCounterAppManager.php).

I get this error on cron run

CommentFileSizeAuthor
#8 2025-04-10_09-29-50.jpg57.07 KBnicholass
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pemson18 created an issue. See original summary.

steffenr’s picture

I had a look into the code. It looks like the cache handling in method gacGetFeed .
This method should return RunReportResponse, but returns an array in case the results are cached.

The change was introduced in https://git.drupalcode.org/project/google_analytics_counter/-/commit/fbb...

steffenr’s picture

Assigned: Unassigned » steffenr

steffenr’s picture

Status: Active » Needs review
nicholass’s picture

Thank you! - Given that I introduced this error it seems only proper I test it. Yeah I didn't catch it since it involved having to wait long enough to have a cached response, but I was getting the same error today when developing locally, a work around was to clear cache before running cron.

But I tested the patch and it works.

nicholass’s picture

Status: Needs review » Reviewed & tested by the community
nicholass’s picture

StatusFileSize
new57.07 KB

s
For me it logged as having invalid or empty data. So I do wonder if the cache-data is working correctly... I may dig into this a bit deeper today.