Problem/Motivation

Google analytics counter 4.x depends on Google\Protobuf which only suggest dependency to bcmath php-extention.

Steps to reproduce

On a server that doesn't have extbcmath installed
Install and enable google analytics counter
Setup api authentification
Run google_analytics_counter cron job
(can also be done using drush ev 'google_analytics_counter_cron()')

This will lead to :
[error] Error: Call to undefined function Google\Protobuf\Internal\bccomp() in Google\Protobuf\Internal\Message->convertJsonValueToProtoValue() (line 961 of /var/www/public_html/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php)

Proposed resolution

Google analytics counter indeed needs bcmath to run so i suggest that we had ext bcmath as as a requirement for this module.
Mention that dependency on module's page

Comments

ericdsd created an issue. See original summary.

kaszarobert’s picture

Assigned: Unassigned » kaszarobert

Thanks for reporting it! I was not aware that the php-analytics-data library does not specify their dependencies properly. As I found that https://github.com/googleapis/google-cloud-php/issues/2400

"For a litany of reasons, we do not want to add bcmath as a dependency in composer.json, but we should consider a better way to handle it."

So they are using 2 PHP Extensions but don't set dependencies for them (facepalm). And they are not even planning to set it in the future. I guess, I have to add that into this module's composer.json.

  • kaszarobert authored e5256df2 on 4.0.x
    Issue #3381609 by ericdsd, kaszarobert: Add dependency to bcmath php...
kaszarobert’s picture

Title: Add dependency to bcmath php extension » Add dependency to bcmath php extension because the php-analytics-data library does not specify that properly
Assigned: kaszarobert » Unassigned

I updated the module' composer.json.

kaszarobert’s picture

Status: Active » Fixed
ericdsd’s picture

That was fast ! Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.